From f6b16c5256a019f1442115543a229a5fabb607dd Mon Sep 17 00:00:00 2001 From: Jacek Date: Mon, 6 Mar 2023 09:21:39 +0100 Subject: [PATCH] BUGFIX: Prevent KeyError: 'type' fixes #357 --- target_snowflake/stream_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target_snowflake/stream_utils.py b/target_snowflake/stream_utils.py index be7f6297..b2ff0fd8 100644 --- a/target_snowflake/stream_utils.py +++ b/target_snowflake/stream_utils.py @@ -66,7 +66,7 @@ def reset_new_value(record: Dict, key: str, _format: str): reset_new_value(record, key, type_dict['format']) break else: - if 'string' in schema['properties'][key]['type'] and \ + if 'type' in schema['properties'][key] and 'string' in schema['properties'][key]['type'] and \ schema['properties'][key].get('format', None) in {'date-time', 'time', 'date'}: reset_new_value(record, key, schema['properties'][key]['format'])