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

Fix(executor): use timezone-aware object to represent datetime in UTC #3447

Merged
merged 2 commits into from
May 9, 2024

Conversation

georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented May 9, 2024

This fixes a warning emitted on python ≥v3.12:

sqlglot/sqlglot/executor/env.py:243: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
  "UNIXTOTIME": null_if_any(lambda arg: datetime.datetime.utcfromtimestamp(arg))

@georgesittas georgesittas changed the title Chore: fix warnings emitted on >= python 3.12 Fix(executor): use timezone-aware object to represent datetime in UTC May 9, 2024
@georgesittas georgesittas merged commit 0927ae3 into main May 9, 2024
6 checks passed
@georgesittas georgesittas deleted the jo/fix_py12_warnings branch May 9, 2024 23:24
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 this pull request may close these issues.

None yet

2 participants