Skip to content

Conversation

@antznette1
Copy link

@antznette1 antznette1 commented Nov 12, 2025

  • Guard range-based setops for tz-aware DatetimeIndex to avoid RangeIndex assumptions that don’t hold across DST transitions in local time.
  • For tz-aware union, compute union in UTC, then tz-convert back and infer freq. This preserves tz and correct ordering without fabricating nonexistent local times across DST.
  • Flips new test to pass: test_union_across_dst_boundary.
  • Notes:
    • Uses freq="h" alias.
    • Aligns expected unit via .as_unit(left.unit).

Ref: #62915 and tests-only PR #63087.

@antznette1 antznette1 marked this pull request as ready for review November 12, 2025 09:16
@jbrockmendel
Copy link
Member

Before I spend more time on this, did a human write it?

@antznette1
Copy link
Author

antznette1 commented Nov 16, 2025

Before I spend more time on this, did a human write it?

Yes, this was written by me.
I see your point about _can_range_setop: by adding the tz restriction there I’m blocking the range fast path for a lot of cases, which is too broad. The DST bug I’m targeting only needs a special-case in the union logic for tz-aware DatetimeIndex, not a blanket change to _can_range_setop.

@antznette1 antznette1 force-pushed the bug/62915-dst-union-fix branch from 0007f67 to 714d8a7 Compare November 16, 2025 22:36
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.

2 participants