From 42f691acae0595c4f554e166b2690db8f20b6358 Mon Sep 17 00:00:00 2001 From: Marina Samuel Date: Tue, 9 Apr 2019 13:46:00 -0400 Subject: [PATCH] Fix bug assuming 'metadata' exists for every table. --- redash/tasks/queries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redash/tasks/queries.py b/redash/tasks/queries.py index d7d4e9d433..dbac37d290 100644 --- a/redash/tasks/queries.py +++ b/redash/tasks/queries.py @@ -378,7 +378,7 @@ def refresh_schema(data_source_id): "column_metadata": "metadata" in table } new_column_names[table_name] = table['columns'] - new_column_metadata[table_name] = table['metadata'] + new_column_metadata[table_name] = table.get('metadata', None) insert_or_update_table_metadata(ds, existing_tables_set, table_data) models.db.session.flush()