Skip to content

Conversation

floura-angel
Copy link
Contributor

@floura-angel floura-angel commented Sep 29, 2025

@floura-angel floura-angel marked this pull request as ready for review September 29, 2025 12:38
end = Timestamp("1916-12-01", tz="Europe/Oslo")
res = date_range(start, end, freq="MS", ambiguous=True)
exp = date_range(
"1916-08-01", "1916-12-01", freq="MS", tz="Europe/Oslo", ambiguous=True
Copy link
Member

Choose a reason for hiding this comment

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

Could you add another test that uses nonexistent?

@mroeschke mroeschke added the Timezones Timezone data dtype label Sep 29, 2025
Comment on lines 1760 to 1768
expected = [
Timestamp("2015-03-28 01:30:00+00:00"),
Timestamp(
"2015-03-29 02:00:00+01:00"
), # shifted forward over next valid wall time
Timestamp("2015-03-30 01:30:00+01:00"),
]

assert list(result) == expected
Copy link
Member

Choose a reason for hiding this comment

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

Can you use tm.assert_index.equal to compare here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the expected block to ensure dtype and freq match the date_range result.

@mroeschke mroeschke added this to the 3.0 milestone Oct 1, 2025
@mroeschke mroeschke merged commit bd88fa0 into pandas-dev:main Oct 1, 2025
40 of 42 checks passed
@mroeschke
Copy link
Member

Thanks @floura-angel

jzwick pushed a commit to jzwick/pandas that referenced this pull request Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: date_range fails DST transition between start and end.
2 participants