Skip to content

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

Merged
merged 7 commits into from
Jan 19, 2021

Conversation

jbrockmendel
Copy link
Member

@@ -341,6 +341,12 @@ cpdef bint tz_compare(tzinfo start, tzinfo end):
bool
"""
# GH 18523
if is_utc(start):
Copy link
Member

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?

Copy link
Member Author

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

@jreback jreback added the Timezones Timezone data dtype label Jan 19, 2021
Copy link
Contributor

@jreback jreback left a 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?

@jbrockmendel
Copy link
Member Author

can you add a whatsnew note (bug fix ok).

updated

any perf diffs here?

tz_compare checks will be slightly slower, but we'll avoid casting to object in a few cases. not much

@jreback jreback added this to the 1.3 milestone Jan 19, 2021
@jreback jreback merged commit 4f8bb5e into pandas-dev:master Jan 19, 2021
@jbrockmendel jbrockmendel deleted the bug-tz_compare branch January 19, 2021 23:31
nofarm3 pushed a commit to nofarm3/pandas that referenced this pull request Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tz_compare fails to consider string "UTC" and pytz UTC object equal
3 participants