Skip to content

BUG: warning shown when parsing delimited date string even if users can't do anything about it #50232

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

Merged
merged 4 commits into from
Dec 14, 2022

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli marked this pull request as draft December 13, 2022 13:49
@MarcoGorelli MarcoGorelli force-pushed the remove-unnecessary-warning branch from e226268 to 2c0f706 Compare December 13, 2022 13:52
@MarcoGorelli MarcoGorelli marked this pull request as ready for review December 13, 2022 13:52
@MarcoGorelli MarcoGorelli added Datetime Datetime data dtype Warnings Warnings that appear or should be added to pandas labels Dec 13, 2022
@mroeschke mroeschke added this to the 2.0 milestone Dec 13, 2022
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

LGTM

@jbrockmendel
Copy link
Member

are there any contexts where we do want to issue a warning?

@MarcoGorelli
Copy link
Member Author

I wouldn't think so, because users can't pass format nor dayfirst to Timestamp

If anything, maybe Timestamp should become stricter and only accept iso8601 strings?

@jbrockmendel
Copy link
Member

I wouldn't think so, because users can't pass format nor dayfirst to Timestamp

i meant more along the lines of if the warning should be issued when we are parsing sequences. (so it would need to be issued somewhere else presumably)

@MarcoGorelli
Copy link
Member Author

Timestamp doesn't accept sequences, and to_datetime already warns - I've probably misunderstood though, is there another path that accepts sequences that might get here? I'll check more carefully tomorrow

@jbrockmendel
Copy link
Member

and to_datetime already warns

wasnt aware of that. all good here.

@jbrockmendel
Copy link
Member

If anything, maybe Timestamp should become stricter and only accept iso8601 strings?

id be OK with more strict than the status quo (problems have been caused by the parsing code accepting "t2m", though Timestamp still rejects that as OOB for nanosecond reso). iso8601-only is probably too strict for my tastes

long long ago i wrote a dateutil-like parser that passed all/most of the dateutill tests and IIRC it was mostly just a handful of regexes (and appreciably more performant). ill see if i can dig that up.

@MarcoGorelli
Copy link
Member Author

and to_datetime already warns

wasnt aware of that. all good here.

thanks! merging then

@MarcoGorelli MarcoGorelli merged commit 113bdb3 into pandas-dev:main Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WARN: warning shown when parsing delimited date string even if users can't do anything about it
3 participants