Timestamp values: Remove the use of "naive" Python datetime
objects
#667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About
Python: Remove invocations to deprecated
datetime.utcfromtimestamp()
.World: Make datetime handling like it's 2024.
Summary
This is a possible BREAKING CHANGE about returned Python
datetime
objects:Details
When no
time_zone
information is specified when creating a database connection or cursor,datetime
objects will now use Coordinated Universal Time (UTC), like CrateDB is storing timestamp values in this format.This update is coming from a deprecation of Python's
datetime.utcfromtimestamp()
, which is effectively also phasing out the use of "naive" timestamp objects in Python, in favor of using timezone-aware objects, also to represent datetimes in UTC. It may be a breaking change for some users of the library that don't expect to receive "aware"datetime
objects from now on.