kaxil commented on code in PR #75327:
URL: https://github.com/apache/airflow/pull/75327#discussion_r4341478342
##########
providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:
##########
@@ -378,7 +380,10 @@ def inspector(self) -> Inspector:
"SQLAlchemy is required for database inspection. "
"Install it with: pip install
'apache-airflow-providers-common-sql[sqlalchemy]'"
)
- return inspect(self.get_sqlalchemy_engine())
+ # The inspector is cached for the hook's lifetime, so a pooled engine
would keep the
+ # connection it reflected with open until the process exits. NullPool
closes it after
+ # each inspection instead, like run() and get_records() do.
+ return inspect(self.get_sqlalchemy_engine({"poolclass": NullPool}))
Review Comment:
Not that I know of. The inspector's engine is private to it, so with
`:memory:` nothing else could have created tables in that database before this
change either, unless someone wrote through `hook.inspector.bind` directly.
--
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]