-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: DatetimeIndex with non-nano values and freq='D' throws ValueError #50773
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
Conversation
pandas/core/arrays/datetimes.py
Outdated
@@ -357,7 +357,7 @@ def _from_sequence_not_strict( | |||
|
|||
if inferred_freq is None and freq is not None: | |||
# this condition precludes `freq_infer` | |||
cls._validate_frequency(result, freq, ambiguous=ambiguous) | |||
cls._validate_frequency(result, freq, ambiguous=ambiguous, unit=result.unit) |
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.
i have a branch where i added unit=index.unit inside _validate_frequency. any reason to that here instead of there?
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.
sorry which branch?
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.
Just a local branch
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.
yeah that works too
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.
LGTM
thanks @MarcoGorelli |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.