From 24237c658ab1a1730522bfc3185f383d612187e1 Mon Sep 17 00:00:00 2001 From: Katy Chambers Date: Wed, 29 Mar 2023 15:42:38 -0600 Subject: [PATCH] fix: :bug: Adjust UUID formatting for static data tables In the case where a table has neither an updated_at column nor a created_at column, the call to json.dumps() was missing an argument that is included in the other cases. --- src/db_extractor_full.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db_extractor_full.py b/src/db_extractor_full.py index 6a26bde..5eccbb4 100644 --- a/src/db_extractor_full.py +++ b/src/db_extractor_full.py @@ -104,7 +104,7 @@ def db_extractor(): table_data = cursor.fetchall() column_names = [desc[0] for desc in cursor.description] data_with_col_names = [{column_names[i]: row[i] for i in range(len(column_names))} for row in table_data] - json_data = json.dumps(data_with_col_names, cls=UUIDEncoder) + json_data = json.dumps(data_with_col_names, cls=UUIDEncoder, default=str) # If we have created_at but no updated_at, we dump based only on created_at elif found_updated_at == False and found_created_at == True: last_run_time = json_parameter_value['data']['lastRunTime']