Skip to content

Commit c7d5add

Browse files
committed
chore: replace assert with raise
1 parent 3bfa14e commit c7d5add

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

templates/python/config.mustache

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ class {{#lambda.pascalcase}}{{client}}{{/lambda.pascalcase}}Config(BaseConfig):
1616

1717
user_agent = UserAgent().add("{{#lambda.pascalcase}}{{client}}{{/lambda.pascalcase}}")
1818

19-
assert app_id, "`app_id` is missing."
20-
assert api_key, "`api_key` is missing."
19+
if app_id is None or not app_id:
20+
raise ValueError("`app_id` is missing.")
2121

22-
self.headers = {
22+
if api_key is None or not api_key:
23+
raise ValueError("`api_key` is missing.")
24+
25+
self.headers = {
2326
"x-algolia-application-id": app_id,
2427
"x-algolia-api-key": api_key,
2528
"user-agent": user_agent.get(),

0 commit comments

Comments
 (0)