-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
datetime.utcnow and datetime.utcfromtimestamp are deprecated in Python 3.12 #32344
Comments
I am working on a PR for this and will create it once complete. |
Just be warned. We are using pendulum in some places. And in some not. This might have rather undesireable side effects when you replace those deprecated. Not sure how but I know @uranusjr had a document once describing some changes that might be needed to handle the complexity involved and it was not trivial. |
I talked to Paul Ganssle a while ago and these two specifically have few caveats, you basically need to use the version without |
|
I would not call it a bug though. It is rather an improvement as Python 3.12 is not officially supported yet. So a PR is appreciated but will be something like a feature to prepare for support Python 3.12++ in future releases. |
yes |
Unfortunately, I don't have the bandwidth to proceed with the fix. If someone wants to use my work as base please feel free to check the changes at https://github.com/tirkarthi/airflow/tree/fix-datetime |
Apache Airflow version
2.6.2
What happened
The usage of
datetime.utcnow
is deprecated in Python 3.12 and it can be replaced withairflow.utils.timezone.utcnow
and a similar method can be introduced for utcfromtimestamp too in timezone moduleWhat you think should happen instead
No response
How to reproduce
Operating System
Ubuntu
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: