Skip to content

Conversation

@vincbeck
Copy link
Contributor

@vincbeck vincbeck commented Sep 22, 2025

Update all models to use sqlalchemy 2 annotations. Keep it also backward compatible with SQLA 1.

This is required to switch to sqlalchemy 2.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
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.

@vincbeck vincbeck force-pushed the vincbeck/sqla2 branch 2 times, most recently from 3713477 to 6b26260 Compare September 22, 2025 17:31
@vincbeck vincbeck added the full tests needed We need to run full set of tests for this PR to merge label Sep 22, 2025
@vincbeck vincbeck closed this Sep 22, 2025
@vincbeck vincbeck reopened this Sep 22, 2025
@vincbeck vincbeck force-pushed the vincbeck/sqla2 branch 5 times, most recently from 4880099 to 5da471b Compare September 23, 2025 15:01
@vincbeck vincbeck marked this pull request as ready for review September 23, 2025 15:02
@vincbeck vincbeck requested review from Dev-iL and dstandish and removed request for Dev-iL September 23, 2025 16:45
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: do we need to continue supporting SQLA1, or can we "simply" switch to 2.x and update the syntax at the same time?

@vincbeck
Copy link
Contributor Author

vincbeck commented Sep 25, 2025

Question: do we need to continue supporting SQLA1, or can we "simply" switch to 2.x and update the syntax at the same time?

In order to switch to SQLA2 we need 2 things (the 2nd point can be split in 2, so let's say 3 points):

  1. Migrate to FAB 5. We need to have this PR merged: Upgrade FAB to FAB 5 #50960
  2. Resolve all static errors raised by mypy when SQLA2 is enabled. When SQLA2 is used, mypy is really angry and raises more than 900 errors. You can see some example of these errors in SQLA_Migration_Plan.md created by @Dev-iL
    a. Upgrading the models (this PR) resolves more than half
    b. Then we need to resolve them individually

We need to complete all these things in order to switch to SQLA2 so no I do not think and should not do that in the same PR.

abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
dabla pushed a commit to dabla/airflow that referenced this pull request Oct 12, 2025
dabla pushed a commit to dabla/airflow that referenced this pull request Oct 12, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
vincbeck added a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 15, 2025
@vincbeck
Copy link
Contributor Author

This PR was reverted because it made the CI fail. I finally could fix it and is available here: #56330. Any review is appreciated :)

potiuk pushed a commit that referenced this pull request Oct 15, 2025
…traints (#56330)

* Update all models to use `sqlalchemy` 2 annotations (#55954)

* Fix NULL constraints
snreddygopu pushed a commit to Teradata/airflow that referenced this pull request Oct 16, 2025
…traints (apache#56330)

* Update all models to use `sqlalchemy` 2 annotations (apache#55954)

* Fix NULL constraints
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
…traints (apache#56330)

* Update all models to use `sqlalchemy` 2 annotations (apache#55954)

* Fix NULL constraints
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
…traints (apache#56330)

* Update all models to use `sqlalchemy` 2 annotations (apache#55954)

* Fix NULL constraints
TyrellHaywood pushed a commit to TyrellHaywood/airflow that referenced this pull request Oct 22, 2025
…traints (apache#56330)

* Update all models to use `sqlalchemy` 2 annotations (apache#55954)

* Fix NULL constraints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:serialization area:Triggerer full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants