Skip to content

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Dec 22, 2023

Replace usage of deprecated function datetime.utcfromtimestamp and make sure the input date is UTC before subtracting.

Fixes warning:

 tests/integration/client_test.py::CancellableEventsTest::test_cancel_events /src/docker/utils/utils.py:398: 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). delta = dt - datetime.utcfromtimestamp(0) 
Replace usage of deprecated function `datetime.utcfromtimestamp` and make sure the input date is UTC before subtracting. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland force-pushed the fix-datetime_to_timestamp branch from 5c5546c to 1784cc2 Compare December 22, 2023 10:31
Copy link
Contributor

@Khushiyant Khushiyant left a comment

Choose a reason for hiding this comment

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

Fine solution for adding explicit timezone handling and epoch reference.
LGTM!

@thaJeztah
Copy link
Member

Thanks!

@glours @milas PTAL

@milas milas closed this Jan 3, 2024
@milas milas reopened this Jan 3, 2024
@milas
Copy link
Contributor

milas commented Jan 3, 2024

(ignore the close + re-open - was testing out updated repo perms 👼🏻)

Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

Let me bring this one in; looks like CI is happy 🎉

@thaJeztah thaJeztah merged commit f467fd9 into docker:main Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants