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

BUG: DatetimeIndex.union with non-nano #59037

Merged
merged 3 commits into from
Jun 24, 2024

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added setops union, intersection, difference, symmetric_difference Non-Nano datetime64/timedelta64 with non-nanosecond resolution labels Jun 17, 2024
@@ -536,7 +536,7 @@ def _wrap_range_setop(self, other, res_i8) -> Self:
# RangeIndex defaults to step=1, which we don't want.
new_freq = self.freq
elif isinstance(res_i8, RangeIndex):
new_freq = to_offset(Timedelta(res_i8.step))
new_freq = to_offset(Timedelta(res_i8.step, unit=self.unit))
Copy link
Member

Choose a reason for hiding this comment

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

I think you also need a .asunit here

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure thing. Added

@tehunter
Copy link
Contributor

Thanks for the speedy fix!

@mroeschke mroeschke added this to the 3.0 milestone Jun 18, 2024
@mroeschke
Copy link
Member Author

Looks like things are passing here so merging

@mroeschke mroeschke merged commit bd7ece0 into pandas-dev:main Jun 24, 2024
45 of 47 checks passed
@mroeschke mroeschke deleted the bug/union/nonnano branch June 24, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non-Nano datetime64/timedelta64 with non-nanosecond resolution setops union, intersection, difference, symmetric_difference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DatetimeIndex.union gives wrong result with "datetime64[us]"
3 participants