-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: List of years (as string) raises UserWarning with to_datetime #57672
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
Comments
Update: The calling chain is:
When testing with python: import datetime as dt
a = dt.datetime.today()
a.replace(**{'year': 2003})
# alternatively
a.replace(year=2003) Both will raise I suspect this may be a weird change in cpython? Let me check there |
Update: "year is out of day for month" is raised because today is Feb 29th. |
if there's only a single element, then there's nothing to be inconsistent with I think this is expected
yup, this is the issue, thanks for the triage :) |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
List of years (as strings) provided to
to_datetime
raises UserWarning. For some reason, single years and lists of dates do not trigger this warning. This is breaking tests in CI.Expected Behavior
Expect no userwarning.
Installed Versions
N/A
The text was updated successfully, but these errors were encountered: