-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: date_range doesn't propagate ambigous=False to tz_localize #35302
Conversation
pandas/core/arrays/datetimes.py
Outdated
@@ -418,9 +418,9 @@ def _generate_range( | |||
# index is localized datetime64 array -> have to convert | |||
# start/end as well to compare | |||
if start is not None: | |||
start = start.tz_localize(tz).asm8 | |||
start = start.tz_localize(tz, ambiguous).asm8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also pass nonexistent
and write a test case for that issue as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added both
doc/source/whatsnew/v1.1.0.rst
Outdated
@@ -941,7 +941,7 @@ Timezones | |||
^^^^^^^^^ | |||
|
|||
- Bug in :func:`to_datetime` with ``infer_datetime_format=True`` where timezone names (e.g. ``UTC``) would not be parsed correctly (:issue:`33133`) | |||
- | |||
- Bug in :func:`date_range` was raising AmbiguousTimeError for valid input with `ambiguous=False` (:issue:`35297`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this to 1.2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure! I don't think we have doc/source/whatsnew/v1.2.0.rst
atm - shall I create it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure that'd be great.
@mroeschke Getting an error in the doctests that I think is unrelated to this PR:
I merged with master just now so I don't think it's because this branch is out-of-date |
No worries, looks unrelated to this PR Actually sorry, could you move the creation of the 1.2.0 whatsnew doc to a separate PR? Would make this PR cleaner. |
Thanks @arw2019 |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff