Dev-iL commented on code in PR #59218:
URL: https://github.com/apache/airflow/pull/59218#discussion_r2646633318


##########
airflow-core/src/airflow/utils/db_manager.py:
##########
@@ -48,6 +49,21 @@ def __init__(self, session):
         super().__init__()
         self.session = session
 
+    def _release_mysql_metadata_locks(self) -> None:
+        """
+        Release MySQL metadata locks by committing the session.
+
+        MySQL requires metadata locks to be released before DDL operations.
+        This is done by committing the current transaction.
+        This method is a no-op for non-MySQL databases.
+        """
+        if get_dialect_name(self.session) != "mysql":
+            return

Review Comment:
   The method is not MySQL-specific in its usage pattern; it's a utility method 
that happens to only do work for MySQL. Removing the check would require adding 
dialect checks at all 4 call sites (which was removed in response to your 
previous comment).
   
   As compromise - I renamed it to `_release_metadata_locks_if_needed`, which 
makes the conditional nature of it explicit.



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