Skip to content
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

Getting "No module named 'airflow.compat'" #23

Closed
smunveruddin-mwb opened this issue Aug 17, 2022 · 3 comments
Closed

Getting "No module named 'airflow.compat'" #23

smunveruddin-mwb opened this issue Aug 17, 2022 · 3 comments

Comments

@smunveruddin-mwb
Copy link

Hi Team,

While trying to test EMRServerless operator using the github link in requirements file, I am getting the following error

"Broken DAG: [/usr/local/airflow/dags/EMR_Serverless.py] Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/emr_serverless/operators/emr.py", line 22, in
from emr_serverless.hooks.emr import EmrServerlessHook
File "/usr/local/lib/python3.7/site-packages/emr_serverless/hooks/emr.py", line 23, in
from airflow.compat.functools import cached_property
ModuleNotFoundError: No module named 'airflow.compat' "

Versions used in Docker container:

  • Airflow = 2.1.0
  • boto3 = 1.23.9
  • apache-airflow-providers-amazon==3.0.0
  • Python 3.7 Slim-buster

It would be great if someone can suggest me workarounds.

Thanks

@dacort
Copy link
Contributor

dacort commented Aug 17, 2022

Hi @smunveruddin-mwb - I've only tested this with Airflow 2.2.2. I believe the airflow.compat package was added in 2.2.0 so that could be the reason for the exception here.

Can you upgrade to 2.2.x? Or are you pinned on 2.1.0?

@smunveruddin-mwb
Copy link
Author

Hi @dacort, Right now we are not looking at Airflow upgrade. I have made a workaround to add the repo to plugins folder and import cached_property from cached_property package, since it works the same way i believe. The issue has been resolved upon trying this workaround and I am able to submit jobs on EMR Serverless Application.

Thanks for responding to the issue. Really appreciate it.

@dacort
Copy link
Contributor

dacort commented Aug 19, 2022

Sounds good and glad you got it working! For now I'll close this as I don't plan to add support for Airflow <2.2.

@dacort dacort closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants