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

Add Python 3.11 support #27264

Merged
merged 8 commits into from
May 22, 2023
Merged

Add Python 3.11 support #27264

merged 8 commits into from
May 22, 2023

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Oct 25, 2022

Python 3.11 has been released as scheduled on October 25, 2022 and
this is the first attempt to see how far Airflow (mostly dependencies)
are from being ready to officially support 3.11.

The fio

We might decide to release Airflow in 3.11 with those providers
disabled in case they are lagging behind eventually, but for the
moment we want to work with all the projects in concert to be
able to release all providers (Google Provider requires quite
a lot of work and likely Google Team stepping up and community helping
with migration to latest Goofle cloud libraries)


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk
Copy link
Member Author

potiuk commented Oct 25, 2022

There you go.

image

CI.rst Outdated Show resolved Hide resolved
@feluelle
Copy link
Member

Really cool. Unfortunately pyarrow is currently not compatible with 3.11 😐

@feluelle
Copy link
Member

Related apache/arrow#14499

@potiuk potiuk force-pushed the python-3-11 branch 2 times, most recently from 2371ed5 to 0642e35 Compare May 21, 2023 14:02
@potiuk
Copy link
Member Author

potiuk commented May 21, 2023

All is ready.

All tests are passing, everything looks good.

Now, the only thing we need is, we need to wait for the #31322 to be released. Currently it is impossible to find the right "provider" packages to install by airflow and generate constraints for "pypi" installation - that's why I had to cancel the constraint generation that run for ~ 1hr - because some of our providers (transitively) are not compatible with Python 3.11.

Once the providers get released, they will not yet have the Python 3.11 supported' trove classifier set - but they will be regardless discovered as compatible and used by pip` to generate the constraints.

So Python 3.11 support is now in the hands of those who test and vote on providers (cc: @eladkal)

Comment on lines +22 to +28
from airflow import PY311

if PY311:
pytest.skip(
"The tests are skipped because Apache Hive provider is not supported on Python 3.11",
allow_module_level=True,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use pytestmark = pytest.mark.skipif(...) instead?


with pytest.raises(ParamValidationError, match=error_pattern):
Param("21 May 1975", type="string", format="date").resolve()
@pytest.mark.parametrize(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce

@potiuk potiuk force-pushed the python-3-11 branch 2 times, most recently from 41dceba to 2b75487 Compare May 22, 2023 19:39
@potiuk
Copy link
Member Author

potiuk commented May 22, 2023

FINALLY GREEN... MERGING

@potiuk potiuk merged commit c5597d1 into main May 22, 2023
@uranusjr uranusjr deleted the python-3-11 branch May 23, 2023 00:08
| MSSQL | 2017(\*), 2019(\*) | 2017(\*), 2019(\*) |
| | Main version (dev) | Stable version (2.6.1) |
|------------|------------------------------|---------------------------|
| Python | 3.7, 3.8, 3.9, 3.10, 3.11 | 3.7, 3.8, 3.9, 3.10, 3.11 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we supporting Python 3.11 in 2.6.1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope :). Good catch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@potiuk potiuk added this to the Airflow 2.6.2 milestone May 23, 2023
@eladkal eladkal added the type:improvement Changelog: Improvements label Jun 8, 2023
eladkal pushed a commit that referenced this pull request Jun 8, 2023
Add Python 3.11 support

Python 3.11 has been released as scheduled on October 25, 2022 and
finally, after all dependencies got upgraded - we can support it.

---------

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
(cherry picked from commit c5597d1)
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 10, 2023
The official Python image for 3.11 had a brief period when the
date `20120503` has been an acceptable date, but it is not
accepted as of 3.11.4 release on 5th of July.

This PR reverts  the changes in tests implemented in apache#27264 to
accomodate for it and brings back the date as error case.
potiuk added a commit that referenced this pull request Jul 10, 2023
The official Python image for 3.11 had a brief period when the
date `20120503` has been an acceptable date, but it is not
accepted as of 3.11.4 release on 5th of July.

This PR reverts  the changes in tests implemented in #27264 to
accomodate for it and brings back the date as error case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools area:production-image Production image improvements and fixes full tests needed We need to run full set of tests for this PR to merge kind:documentation pinned Protect from Stalebot auto closing type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.