-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
MySqlHook constructor fails with exception after upgrading apache-airflow-providers-common-sql from 1.16.0 to 1.17.0 #42452
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. |
+1, we have the same issue with the same versions |
+1, we're having the same issue as well |
+1 same issue; quick solution that worked for us (don't know why, to be honest), doing a pip install with this: apache-airflow-providers-mysql>=5.7.1 |
+1 same issue but for postgres
|
@tboschtxr , can you use |
I will give this a try now. |
@rawwar this did work yes, thank you! |
This looks like it is resolved with the latest version of apache-airflow-providers-mysql. However I would like to leave this open for visibility because having dependencies defined without version constraints between providers that might be updated independently could cause things like this to break again in the future due to Because apache-airflow-providers-mysql has no upper version constraint on its apache-airflow-providers-common-sql dependency, any breaking change to a public API in a future version of apache-airflow-providers-common-sql can break existing airflow installs. |
Just traced the code a bit. This was due to a change in The reason why |
I'll send a PR for adding a dummy setter for backcompat. |
This is probably due to my PR 40751, a dummy setter would indeed solve the issue |
Apache Airflow Provider(s)
common-sql, mysql
Versions of Apache Airflow Providers
apache-airflow-providers-common-sql 1.17.0
apache-airflow-providers-mysql 5.6.1
Apache Airflow version
2.9.2+astro.1
Operating System
debian astronomer/astro-runtime:11.5.0
Deployment
Astronomer
Deployment details
This is an Astronomer-hosted deployment. Docker image is quay.io/astronomer/astro-runtime:11.5.0
What happened
DAGs that interact with MySqlHook started failing after apache-airflow-providers-common-sql was automatically upgraded from 1.16.0 to 1.17.0.
Here is an example error from the log:
requirements.txt had apache-airflow-providers-mysql with no version constraint.
Forcing downgrade to the previous version fixes the problem and allows the DAGs to run again:
What you think should happen instead
Because we are including apache-airflow-providers-mysql without a version constraint, I would hope and expect that it would only bring in a version of apache-airflow-providers-common-sql that is compatible with the version of apache-airflow-providers-mysql that is being used. That does not appear to be happening here.
How to reproduce
apache-airflow-providers-common-sql 1.17.0
apache-airflow-providers-mysql 5.6.1
This will throw an AttributeError:
Anything else
This is consistently reproducible with the listed provider versions.
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: