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

[Test failure] Airflow 2.4, 2.5, 2.6 - ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' #240

Closed
pankajkoti opened this issue Oct 11, 2024 · 1 comment · Fixed by #237
Assignees

Comments

@pankajkoti
Copy link
Contributor

pankajkoti commented Oct 11, 2024

GitHub action link https://github.com/astronomer/dag-factory/actions/runs/11288449566/job/31396239719?pr=237

Observed in PR: #237

Affected Airflow version jobs: 2.4, 2.5, 2.6

==================================== ERRORS ====================================
__________________ ERROR collecting tests/test_dagbuilder.py ___________________
ImportError while importing test module '/home/runner/work/dag-factory/dag-factory/tests/test_dagbuilder.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/requests_toolbelt/_compat.py:48: in <module>
    from requests.packages.urllib3.contrib import appengine as gaecontrib
E   ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/home/runner/.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/urllib3/contrib/__init__.py)

During handling of the above exception, another exception occurred:
tests/test_dagbuilder.py:12: in <module>
    from airflow.providers.http.sensors.http import HttpSensor
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/airflow/providers/http/sensors/http.py:21: in <module>
    from airflow.providers.http.hooks.http import HttpHook
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/airflow/providers/http/hooks/http.py:[23](https://github.com/astronomer/dag-factory/actions/runs/11288449566/job/31396239719?pr=237#step:6:24): in <module>
    from requests_toolbelt.adapters.socket_options import TCPKeepAliveAdapter
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/requests_toolbelt/__init__.py:12: in <module>
    from .adapters import SSLAdapter, SourceAddressAdapter
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/requests_toolbelt/adapters/__init__.py:12: in <module>
    from .ssl import SSLAdapter
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/requests_toolbelt/adapters/ssl.py:16: in <module>
    from .._compat import poolmanager
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/requests_toolbelt/_compat.py:50: in <module>
    from urllib3.contrib import appengine as gaecontrib
E   ImportError: cannot import name 'appengine' from 'urllib3.contrib' (/home/runner/.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/urllib3/contrib/__init__.py)

During handling of the above exception, another exception occurred:
../../../.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/requests_toolbelt/_compat.py:48: in <module>
    from requests.packages.urllib3.contrib import appengine as gaecontrib
E   ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/home/runner/.local/share/hatch/env/virtual/dag-factory/onaeQMJR/tests.py3.8-2.4/lib/python3.8/site-packages/urllib3/contrib/__init__.py)
@pankajkoti pankajkoti changed the title [CI test failure] Airflow 2.4 - ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' [CI test failure] Airflow 2.4, 2.5 - ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' Oct 11, 2024
@pankajkoti pankajkoti changed the title [CI test failure] Airflow 2.4, 2.5 - ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' [CI test failure] Airflow 2.4, 2.5, 2.6 - ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' Oct 11, 2024
@pankajkoti pankajkoti added this to the DAG Factory 0.20.0 milestone Oct 11, 2024
@pankajkoti pankajkoti changed the title [CI test failure] Airflow 2.4, 2.5, 2.6 - ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' [Test failure] Airflow 2.4, 2.5, 2.6 - ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' Oct 14, 2024
@pankajkoti pankajkoti self-assigned this Oct 14, 2024
@pankajkoti
Copy link
Contributor Author

This occurred due to reinstallation of urllib3 coming from dependencies that were not required in the tests env (I think one of types-requests or Werkzeug). The unneeded dependencies were cleaned up in PR #237 from the hatch test env by not installing them and the error went away.

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

Successfully merging a pull request may close this issue.

1 participant