Skip to content

Commit 832667c

Browse files
committed
Add safeguard
1 parent b0859e9 commit 832667c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

aircan/dags/api_ckan_import_to_bq_v2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def task_import_resource_to_bq(**context):
5858

5959
raw_schema = context['params'].get('resource', {}).get('schema')
6060
eval_schema = json.loads(raw_schema)
61+
if isinstance(eval_schema, str):
62+
eval_schema = ast.literal_eval(eval_schema)
6163
schema = eval_schema.get('fields')
6264
logging.info("SCHEMA: {}".format(schema))
6365

0 commit comments

Comments
 (0)