Skip to content

BUG: DTI.intersection with DST transition #48167

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
Aug 21, 2022

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added Timezones Timezone data dtype setops union, intersection, difference, symmetric_difference Timestamp pd.Timestamp and associated methods labels Aug 19, 2022
@mroeschke mroeschke added this to the 1.4.4 milestone Aug 19, 2022
if self.tz is not None and not timezones.is_utc(self.tz):
return False
other_tz = getattr(other, "tz", None)
if other_tz is not None and not timezones.is_utc(other_tz):
Copy link
Member

Choose a reason for hiding this comment

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

fine if you want to do quick fix, but could also include fixed-offset tzs. also i think we're assured matching types/dtypes at this point

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a check for not timezones.is_fixed_offset.

Yeah I think a more complete check would be to add a .fold attribute and then check self.fold.nunique > 1. That would allow some DatetimeIndexes to still use the distpatch to range ops. #47130

@mroeschke mroeschke merged commit 70f981f into pandas-dev:main Aug 21, 2022
@mroeschke mroeschke deleted the bug/dti_intersection_dst branch August 21, 2022 19:52
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Aug 21, 2022
simonjayhawkins pushed a commit that referenced this pull request Aug 22, 2022
…ansition) (#48189)

Backport PR #48167: BUG: DTI.intersection with DST transition

Co-authored-by: Matthew Roeschke <[email protected]>
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
* BUG: DTI.intersection with DST transition

* Add whatsnew note

* Add fixed offset as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
setops union, intersection, difference, symmetric_difference Timestamp pd.Timestamp and associated methods Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DatetimeIndex.intersection not working for localized indices
3 participants