fix: silence deprecation warnings causing noisy production logs (#38128)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Amin Ghadersohi
2026-03-02 13:55:00 -05:00
committed by GitHub
parent 00a1487705
commit 01d5245cd2
7 changed files with 41 additions and 20 deletions

View File

@@ -1183,10 +1183,11 @@ class Database(CoreDatabase, AuditMixinNullable, ImportExportMixin): # pylint:
def has_table(self, table: Table) -> bool:
with self.get_sqla_engine(catalog=table.catalog, schema=table.schema) as engine:
inspector = sqla.inspect(engine)
# do not pass "" as an empty schema; force null
if engine.has_table(table.table, table.schema or None):
if inspector.has_table(table.table, table.schema or None):
return True
return engine.has_table(table.table.lower(), table.schema or None)
return inspector.has_table(table.table.lower(), table.schema or None)
def has_view(self, table: Table) -> bool:
with self.get_sqla_engine(catalog=table.catalog, schema=table.schema) as engine: