-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Airflow 2.8.1 contains migration requiring SQLAlchemy 2+ #36912
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
I took a look at the Alembic changelog and realised 1.13.0 fixes a bug where some operations by mistake were marked as requiring SQLAlchemy 2.0+. Upgrading our version of Alembic from 1.12.0 to the latest 1.13.1 version also fixes this problem. Would it perhaps be a good idea to require the Alembic version to be at minimum version 1.13.0 so other people don't bump into this? |
You need to install Airflow by provide constraints for specific Airflow and Python versions, for example in your case pip install "apache-airflow==2.8.1” --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt" This action will prevent surprises when upstream package is (not)updated and breaks some critical part of the Airflow. Lines 77 to 79 in ae9614d
For the reference: |
What a bizarre setup. I guess I'll have to see if I can somehow get that shoehorned into how we manage dependencies. Thank you for the pointer. |
It's not bizarre, it's just. It is just designed for both - allowing for reproducible installation AND allowing people to upgrede depedencies when they neeed. In a few years a form of it will become a norm, simply the Python packaging and installation world did not yet feel then need for it, but with 670 dependencies of Airflow, this saves our users a lot of headaches, while allowing them also to use newer version of libraries. If they follow our advices that is. If you want to know more about and have more context - I recommend to watch my talk from Airlfow Summit https://airflowsummit.org/sessions/2023/mastering-dependencies-the-airflow-way/ |
BTW. yes. I agree, likely adding alembic min version in this case is a good idea as well. Alembic has very little dependencies on its own so this error is a good reason to add min-version for 2.8.2. |
There are some errors for users who still use sqlalchemy 1, where Alembic 1.13.0 wrongly marks some migration as SqlAlchemy 2+ Fixes: apache#36912
There are some errors for users who still use sqlalchemy 1, where Alembic 1.13.0 wrongly marks some migration as SqlAlchemy 2+ Fixes: #36912
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.8.1
What happened?
I've upgraded our Airflow installation to the newly released version 2.8.1 and ran
airflow db upgrade
, as prompted by the message when Airflow tries to start up.That, however, resulted in the following stack trace:
What you think should happen instead?
Ideally, the migration should run without issues, using a version of SQLAlchemy that Airflow supports.
How to reproduce
Upgrade an existing Airflow installation to version 2.8.1. Run
airflow db upgrade
.Operating System
Docker
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==8.16.0
apache-airflow-providers-celery==3.4.1
apache-airflow-providers-common-io==1.2.0
apache-airflow-providers-common-sql==1.7.2
apache-airflow-providers-ftp==3.5.2
apache-airflow-providers-google==10.13.1
apache-airflow-providers-http==4.5.2
apache-airflow-providers-imap==3.3.2
apache-airflow-providers-mysql==5.5.1
apache-airflow-providers-sqlite==3.4.3
Deployment
Other Docker-based deployment
Deployment details
No response
Anything else?
SQLAlchemy related packages:
Flask-SQLAlchemy==2.5.1
marshmallow-sqlalchemy==0.26.1
SQLAlchemy==1.4.49
sqlalchemy-bigquery==1.8.0
SQLAlchemy-JSONField==1.0.1.post0
sqlalchemy-redshift==0.8.14
sqlalchemy-spanner==1.6.2
SQLAlchemy-Utils==0.41.1
Alembic is at version 1.12.0.
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: