jedcunningham commented on code in PR #31486:
URL: https://github.com/apache/airflow/pull/31486#discussion_r1205749602
##########
airflow/utils/db.py:
##########
@@ -1004,15 +1010,17 @@ def reflect_tables(tables: list[Base | str] | None,
session):
"""
import sqlalchemy.schema
- metadata = sqlalchemy.schema.MetaData(session.bind)
+ bind = session.bind
+ metadata = sqlalchemy.schema.MetaData()
+ metadata.bind = bind
if tables is None:
- metadata.reflect(resolve_fks=False)
+ metadata.reflect(bind=bind, resolve_fks=False)
else:
for tbl in tables:
try:
table_name = tbl if isinstance(tbl, str) else tbl.__tablename__
- metadata.reflect(only=[table_name], extend_existing=True,
resolve_fks=False)
+ metadata.reflect(bind=bind, only=[table_name],
extend_existing=True, resolve_fks=False)
Review Comment:
Do we need the `metadata.bind` line also then? Seems odd to need both.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]