Skip to content

Commit

Permalink
fix(dataset): handle missing database in migration (#18948)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2bacedd)
  • Loading branch information
villebro committed Apr 3, 2022
1 parent 9375ebf commit 268ce0a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 268ce0a

Please sign in to comment.