Skip to content

Updating and re-opening PR #48129 #50541

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

Closed
wants to merge 16 commits into from
Closed

Conversation

srotondo
Copy link
Contributor

@srotondo srotondo commented Jan 3, 2023

@gfyoung gfyoung added Bug Datetime Datetime data dtype Numeric Operations Arithmetic, Comparison, and Logical operations Timezones Timezone data dtype labels Jan 7, 2023
@@ -761,7 +761,10 @@ def _add_offset(self, offset) -> DatetimeArray:
assert not isinstance(offset, Tick)

if self.tz is not None:
values = self.tz_localize(None)
if not offset._use_relativedelta:
Copy link
Member

Choose a reason for hiding this comment

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

is there a viable way to handle this inside the Offset code? in theory the DTA code shouldn't need to know anything about _use_relativedelta

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is with how these dates are localized, and I don't believe there is a good way to modify this in the Offset code.

]
)
offset1 = DateOffset(hours=3)
offset2 = DateOffset(days=1)
Copy link
Member

Choose a reason for hiding this comment

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

looks like this only tests the DateOffset class, for which _use_relativedelta can be True. but the code you changed affects a bunch of other classes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I'll try and work on some tests for the other classes.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Mar 6, 2023
@srotondo
Copy link
Contributor Author

srotondo commented Mar 8, 2023

Sorry this went stale, I've been really busy lately, I think I'll be able to find time to clean this up soon.

@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Numeric Operations Arithmetic, Comparison, and Logical operations Stale Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DatetimeIndex and Timestamp behave inconsistently with respect to pd.DateOffset
5 participants