mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
fix(dataset): handle missing database in migration (#18948)
This commit is contained in:
parent
147dc5af71
commit
2baceddbf1
@ -321,8 +321,10 @@ def after_insert(target: SqlaTable) -> None: # pylint: disable=too-many-locals
|
||||
# table names
|
||||
database = (
|
||||
target.database
|
||||
or session.query(Database).filter_by(id=target.database_id).one()
|
||||
or session.query(Database).filter_by(id=target.database_id).first()
|
||||
)
|
||||
if not database:
|
||||
return
|
||||
engine = database.get_sqla_engine(schema=target.schema)
|
||||
conditional_quote = engine.dialect.identifier_preparer.quote
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user