fix(catalog): Table Schema View with no catalog (#30139)

This commit is contained in:
Antonio Rivero 2024-09-04 02:41:47 +02:00 committed by GitHub
parent 09dfe2f2ab
commit 6009023fad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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),