-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deprecate tryparse(T, s) in favor of parse(Union{T, Void}, s) #25131
Conversation
"in favor of parse(Union{T, Void}, s)" That's a good candidate for |
The idea is that for missing values you'd better check explicitly for As for |
That's true, but that concerns data import. |
Ah, OK, that's a totally different question. I think it should behave just like any other |
Perhaps the easiest would be if |
b12664a
to
38ee4f9
Compare
38ee4f9
to
487603a
Compare
The more I think about
|
Adding a new type just for one function doesn't sound worth it to me. |
OTOH: returning an error object capturing something about the parse error might be helpful. |
Yeah. The advantage of merging |
That sounds like a great plan to me! |
How scalable |
Possibly, but that's a matter of future work. Practically, I'm not sure why you want a vector of values or errors, it seems to me that you'd probably want to handle errors as you encounter them, but it's nice to not have to use try/catch to get parse errors. |
For example when importing dataframes that contain errors (misformatted values). Union{Int, Void, Missing}[s !== missing ? parse(Union{Int,Void}, s) : missing for s in str_col] But it would be nice to |
Should we do this or not? |
This doesn't seem quite right to me --- if you ask |
Triage agrees using the type argument to select whether an error is thrown is not ideal. |
See previous discussions at #16981.