Skip to content

Conversation

@andriawang6
Copy link

@andriawang6 andriawang6 commented Jul 30, 2025

addresses #1781

@andriawang6 andriawang6 force-pushed the replace-utcfromtimestamp branch from 687ac1a to 250f015 Compare July 30, 2025 00:58
@andriawang6 andriawang6 marked this pull request as ready for review July 30, 2025 01:06
@andriawang6 andriawang6 requested review from a team as code owners July 30, 2025 01:06
@gkevinzheng gkevinzheng requested a review from a team as a code owner December 17, 2025 19:26
gkevinzheng
gkevinzheng previously approved these changes Dec 17, 2025
@gkevinzheng gkevinzheng changed the title replace deprecated utcfromtimestamp fix: replace deprecated utcfromtimestamp Dec 17, 2025
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Dec 17, 2025
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Dec 17, 2025
@gkevinzheng gkevinzheng enabled auto-merge (squash) December 17, 2025 19:35
@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 17, 2025
@parthea parthea disabled auto-merge December 17, 2025 20:50
@parthea parthea self-assigned this Dec 17, 2025
@gkevinzheng gkevinzheng dismissed their stale review December 18, 2025 15:34

Failing tests due to not stripping tzinfo

@gkevinzheng
Copy link
Contributor

gkevinzheng commented Dec 18, 2025

Hi @andriawang6,

I don't think you can simply replace utcfromtimestamp with fromtimestamp(tz=datetime.timezone.utc) since utcfromtimestamp is not offset aware, whereas fromtimestamp is. This causes issues with comparing timestamps. We've resolved a similar issue in the past (see this discussion) by adding a .replace(tzinfo=None) after creating the timestamp object with fromtimestamp(tz=datetime.timezone.utc). You can add it to google/auth/_helpers.py like we did the function definition for utcnow

Also see this PR: #1413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants