You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Dev-iL (via GitHub)" <gi...@apache.org> on 2025/06/30 08:22:03 UTC

[PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Dev-iL opened a new pull request, #52518:
URL: https://github.com/apache/airflow/pull/52518

   The current intention is to have dual-support of SQLAlchemy 1.4 and 2.0. The most recent effort is #52233 - which adds a couple of CI jobs and the various fixes (business logic and flakiness) allowing them to succeed. This PR cherry-picks all the fixes included in #52233 (i.e. without FAB, breeze, migrations, etc.) for easier review.
   
   A successful CI run for this PR should demonstrate that 1.4 support is intact (as far as the test coverage can tell).
   
   Related: #28723
   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
   


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


Re: [PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on PR #52518:
URL: https://github.com/apache/airflow/pull/52518#issuecomment-3020431498

   Cool!
   #protm


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


Re: [PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Posted by "Dev-iL (via GitHub)" <gi...@apache.org>.
Dev-iL commented on code in PR #52518:
URL: https://github.com/apache/airflow/pull/52518#discussion_r2174518465


##########
airflow-core/src/airflow/models/base.py:
##########
@@ -52,6 +53,10 @@ def _get_schema():
     Base = Any
 else:
     Base = mapper_registry.generate_base()
+    # TEMPORARY workaround to allow using unmapped (v1.4) models in SQLAlchemy 2.0. It is intended only to
+    # unblock the development of SQLA2 support.

Review Comment:
   The need to remove this is clear enough from the existing text. Will update in there are other changes requested to this file.



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


Re: [PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #52518:
URL: https://github.com/apache/airflow/pull/52518


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


Re: [PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Posted by "Dev-iL (via GitHub)" <gi...@apache.org>.
Dev-iL commented on PR #52518:
URL: https://github.com/apache/airflow/pull/52518#issuecomment-3339815448

   @edsu Please see my answer [here](https://github.com/apache/airflow/issues/28723#issuecomment-3339813524).


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


Re: [PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Posted by "edsu (via GitHub)" <gi...@apache.org>.
edsu commented on PR #52518:
URL: https://github.com/apache/airflow/pull/52518#issuecomment-3339473067

   Does this mean it is now possible to use Airflow with SQLA 2?


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


Re: [PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #52518:
URL: https://github.com/apache/airflow/pull/52518#discussion_r2174506750


##########
airflow-core/src/airflow/models/base.py:
##########
@@ -52,6 +53,10 @@ def _get_schema():
     Base = Any
 else:
     Base = mapper_registry.generate_base()
+    # TEMPORARY workaround to allow using unmapped (v1.4) models in SQLAlchemy 2.0. It is intended only to
+    # unblock the development of SQLA2 support.

Review Comment:
   [nitpick] The temporary workaround using Base.__allow_unmapped__ is a useful interim solution but should be clearly documented with a TODO or similar note to revisit once full SQLAlchemy 2.0 support is complete.
   ```suggestion
       # unblock the development of SQLA2 support.
       # TODO: Remove this workaround once full SQLAlchemy 2.0 support is implemented.
   ```



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


Re: [PR] Fix various incompatibilities with SQLAlchemy 2.0 [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on PR #52518:
URL: https://github.com/apache/airflow/pull/52518#issuecomment-3018652696

   Awesome @Dev-iL 🎉 


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