From 6009023fad360ddb13aa0ad1d382400b1c38e294 Mon Sep 17 00:00:00 2001 From: Antonio Rivero <38889534+Antonio-RiveroMartnez@users.noreply.github.com> Date: Wed, 4 Sep 2024 02:41:47 +0200 Subject: [PATCH] fix(catalog): Table Schema View with no catalog (#30139) --- superset/views/sql_lab/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/views/sql_lab/views.py b/superset/views/sql_lab/views.py index 3b24f7c0e..29d0fdba7 100644 --- a/superset/views/sql_lab/views.py +++ b/superset/views/sql_lab/views.py @@ -239,7 +239,7 @@ class TableSchemaView(BaseSupersetView): db.session.query(TableSchema).filter( TableSchema.tab_state_id == table["queryEditorId"], TableSchema.database_id == table["dbId"], - TableSchema.catalog == table["catalog"], + TableSchema.catalog == table.get("catalog"), TableSchema.schema == table["schema"], TableSchema.table == table["name"], ).delete(synchronize_session=False) @@ -247,7 +247,7 @@ class TableSchemaView(BaseSupersetView): table_schema = TableSchema( tab_state_id=table["queryEditorId"], database_id=table["dbId"], - catalog=table["catalog"], + catalog=table.get("catalog"), schema=table["schema"], table=table["name"], description=json.dumps(table),