◐ Shell
clean mode source ↗

fix: Deprecated the datetime.utcfromtimestamp(). by shuchu · Pull Request #4306 · feast-dev/feast

Conversation

@shuchu

What this PR does / why we need it:

Change from

>>> dt_now = datetime.utcnow()
>>> dt_ts = datetime.utcfromtimestamp(1571595618.0)

to

>>> from datetime import timezone
>>> dt_now = datetime.now(tz=timezone.utc)
>>> dt_ts = datetime.fromtimestamp(1571595618.0, tz=timezone.utc)

Reference: https://blog.ganssle.io/articles/2019/11/utcnow.html

Which issue(s) this PR fixes:

Partial Fixes #4240

Signed-off-by: Shuchu Han <shuchu.han@gmail.com>

tokoko

Choose a reason for hiding this comment

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

lgtm

sudohainguyen

franciscojavierarceo

redhatHameed pushed a commit to RHEcosystemAppEng/feast that referenced this pull request

Aug 5, 2024

shuchu pushed a commit to shuchu/feast that referenced this pull request

Aug 14, 2024

Labels