-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: combine 'coerce' and 'errors' keywords of to_datetime #10653
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
You are probably aware but let me just point out that |
@kawochen What do you mean exactly? |
I am +1 on this |
@jorisvandenbossche I meant that when you want more exception coverage you use
|
ah, I see, but I would maybe rather consider that a bug (or undocumented issue) in that it should not raise an error but give the original value back? (that's what Are there cases than too big integers where something like this happens? |
There are cases when even
And cases when
|
@kawochen those are almost certainly errors, because of the confusion on the cython side. E.g. the |
Sure. I just wanted to see what breaks. I have no legit use cases for them |
@kawochen yes, and that is very useful! But indeed, as @jreback says, it are more bugs in the current implementation. Do you want to open a separate issue for those? @jreback the only reason I would be a bit hesitant for this change, is that we just changed it in |
@jorisvandenbossche I think that it would be ok to change |
From #10636
When parsing an invalid date, there are some possible different actions to take:
errors='ignore'
)errors='raise'
)coerce=True
)AFAIK, these three options are just three different options and mutually exclusive (or is there somewhere in the codebase an interaction between both?), so they could be controlled by a single keyword.
Having two keyword can make it even confusing what you should expect when combining those two, eg the example of coerce=True and error=raise.
Proposal: add another
'coerce'
option to theerrors
keyword that is equivalent tocoerce=True
-> this gives the
errors
keyword three options:'ignore'|'raise'|'coerce'
The text was updated successfully, but these errors were encountered: