You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vincbeck (via GitHub)" <gi...@apache.org> on 2025/10/22 12:24:27 UTC

Re: [PR] Fix remaining MyPy type errors in utils/ [airflow]

vincbeck commented on code in PR #56982:
URL: https://github.com/apache/airflow/pull/56982#discussion_r2451908223


##########
airflow-core/src/airflow/utils/sqlalchemy.py:
##########
@@ -355,12 +356,14 @@ def with_row_locks(
     :param kwargs: Extra kwargs to pass to with_for_update (of, nowait, skip_locked, etc)
     :return: updated query
     """
+    if session.bind is None:

Review Comment:
   Same



##########
airflow-core/src/airflow/utils/db.py:
##########
@@ -1346,7 +1346,11 @@ def create_global_lock(
     lock_timeout: int = 1800,
 ) -> Generator[None, None, None]:
     """Contextmanager that will create and teardown a global db lock."""
-    conn = session.get_bind().connect()
+    bind = session.get_bind()

Review Comment:
   Maybe you can use https://github.com/apache/airflow/pull/56941 to get the dialect?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org