-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API/BUG: treat different UTC tzinfos as equal #39216
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
Conversation
jbrockmendel
commented
Jan 16, 2021
- closes tz_compare fails to consider string "UTC" and pytz UTC object equal #23959
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
@@ -341,6 +341,12 @@ cpdef bint tz_compare(tzinfo start, tzinfo end): | |||
bool | |||
""" | |||
# GH 18523 | |||
if is_utc(start): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test to ensure all the components of the utc_fixture
are equivalent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just tried this and we have several utc_fixture members that arent recognized by is_utc, will need to fix that separately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a whatsnew note (bug fix ok). any perf diffs here?
updated
tz_compare checks will be slightly slower, but we'll avoid casting to object in a few cases. not much |