Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overflow issue in hour check for timedelta #70

Merged
merged 8 commits into from
Jun 26, 2024
Merged

Conversation

sydney-runkle
Copy link
Member

No description provided.

@davidhewitt
Copy link
Contributor

I think that line got copied from another point in the code, so might be worth having a quick check if other locations are similarly problematic

@sydney-runkle
Copy link
Member Author

See https://github.com/pydantic/pydantic-core/actions/runs/9683851266/job/26720269595?pr=1347 for the place where we discovered this error!

@sydney-runkle
Copy link
Member Author

Seems like other occurrences are guarded by ascii checks: https://github.com/search?q=repo%3Apydantic%2Fspeedate%20-%20b%270%27&type=code

@davidhewitt
Copy link
Contributor

davidhewitt commented Jun 26, 2024

Actually a last minute thought - wrapping_sub may be sufficient here and might be faster because no need to branch. Might be interesting to benchmark 😁

@davidhewitt
Copy link
Contributor

(or it could be that the difference comes out as noise)

@sydney-runkle sydney-runkle merged commit a036efb into main Jun 26, 2024
7 checks passed
@sydney-runkle sydney-runkle deleted the overflow-fix branch June 26, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants