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

Move away from legacy importlib.resources API #19091

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

uranusjr
Copy link
Member

importlib.resources deprecated the top-level read_binary() and similar functions in favor of the new files() API. This is only available in Python 3.9 and later, so the importlib-resources backport has been bumped to be also installed on 3.7 and 3.8.

This should fix the errors in the provider tests and make CI green again.

importlib.resources deprecated the top-level read_binary() and similar
functions in favor of the new files() API. This is only available in
Python 3.9 and later, so the importlib-resources backport has been
bumped to be also installed on 3.7 and 3.8.
@uranusjr
Copy link
Member Author

BTW the functools.cache import in providers_manager doesn't seem to be used anywhere, so I removed it as well.

@mik-laj
Copy link
Member

mik-laj commented Oct 20, 2021

CC: @lwyszomi

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Oct 20, 2021
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@lwyszomi
Copy link
Contributor

🎉 🎉 🎉

@potiuk potiuk closed this Oct 20, 2021
@potiuk potiuk reopened this Oct 20, 2021
@potiuk
Copy link
Member

potiuk commented Oct 20, 2021

Reopening to check if it works for all Python versions.

@uranusjr uranusjr force-pushed the importlib-resources-deprecation branch from 07afbfa to b213021 Compare October 21, 2021 09:54
@uranusjr
Copy link
Member Author

A couple of jobs got killed but CI otherwise passing. Should be good to go.

@uranusjr uranusjr merged commit ed40c4b into apache:main Oct 21, 2021
@uranusjr uranusjr deleted the importlib-resources-deprecation branch October 21, 2021 11:12
sharon2719 pushed a commit to sharon2719/airflow that referenced this pull request Oct 27, 2021
@potiuk potiuk added this to the Airflow 2.2.3 milestone Dec 12, 2021
potiuk pushed a commit that referenced this pull request Dec 12, 2021
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants