Closed
Description
Hello there,
Although as of 1.7.0, deprecation of datetime.utcnow()
was delt with by @RazerM ( 5273fa2 ), it seems like datetime.utcfromtimestamp()
also requires some attention.
The official datetime docs point out:
Warning: Because naive
datetime
objects are treated by manydatetime
methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing a specific timestamp in UTC is by callingdatetime.fromtimestamp(timestamp, tz=timezone.utc)
.
For context, stumbled upon the deprecation warning while unittesting dbt-core
, as part of issue 9791. When drilling down the logs, ended up at:
Line 143 in e7cc074
Metadata
Metadata
Assignees
Labels
No labels