kaxil commented on code in PR #75327:
URL: https://github.com/apache/airflow/pull/75327#discussion_r4341473573


##########
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.

Review Comment:
   Yeah, I meant the outcome, not the mechanism. Reworded it to "no connection 
outlives the inspection that opened it".
   



-- 
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]

Reply via email to