-
Notifications
You must be signed in to change notification settings - Fork 15.1k
BatchOperator incompatible with airflow 3 #50535
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
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. |
@eladkal could you please assign it to me? I would like to work on this issue. |
@potiuk may I ask you to assign this issue on me please? |
Looks like @Shashwatpandey4 already created PR for that issue :) @potiuk please assign this issue on him :) |
If you are referring to #50751 that does not address this issue. |
@davidcroda sorry, my bad :) it appears in issue for some reason |
Apache Airflow Provider(s)
amazon
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==9.7.0
Apache Airflow version
3.0.1
Operating System
Debian GNU/Linux 12 (bookworm)
Deployment
Astronomer
Deployment details
No response
What happened
The BatchOperator is unable to be used when invoked with the .expand function. It fails to be parsed with the following error.
I believe this is due to the following check failing: https://github.com/apache/airflow/blob/main/providers/amazon/src/airflow/providers/amazon/aws/operators/batch.py#L148-L157
Because MappedOperator is imported from the old import path it is failing the isinstance check on airflow 3.
I am willing to make a PR to fix it but I'm not familiar enough with airflow to know how to fix this in a way which would would be backwards compatible.
What you think should happen instead
The BatchOperator uses an older import path for MappedOperator. This causes the isinstance check to fail on line 148. This check or import should be updated in a way that is compatible with both airflow 2.x and airflow 3. I was able to monkey patch the issue in my own dag with the following code:
How to reproduce
Here is a minimal example which reproduces the issue on airflow 3
Anything else
Here is the error log from the example for posterity, similar to the one in my original issue:
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: