Skip to content

Conversation

@Aniketsy
Copy link
Contributor

This PR updates logic selects the finest unit between the array and the offset, preventing rounding errors. A regression test is included to confirm correct behavior for affected offsets and units.

Please let me know if my approach or fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.
Thankyou !

@Aniketsy Aniketsy marked this pull request as draft September 20, 2025 09:30
@Aniketsy Aniketsy marked this pull request as ready for review October 5, 2025 06:54
@Aniketsy
Copy link
Contributor Author

Hi @jbrockmendel I think i might be a bit lost here. Could you please guide me if i’m heading in the wrong direction? Thank you!

idx_self = units.index(self.unit)
idx_offset = units.index(offset_unit)
res_unit = units[min(idx_self, idx_offset)]
if isinstance(offset, Tick) or (
Copy link
Member

Choose a reason for hiding this comment

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

what you had before here seemed much more reasonable. i dont see any reason for this to be specific to CustomBusinessDay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks , then i will stick to previous changes there were many test failing , so i started from start.

@Aniketsy Aniketsy force-pushed the fix-dt64-offset-rounding branch from ac80418 to 259a5e4 Compare October 27, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: dt64[non_nano] + some_offsets incorrectly rounding

2 participants