-
Notifications
You must be signed in to change notification settings - Fork 45
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
Handling errors without raising exceptions #90
Comments
SummaryI'm not against the idea of returning What is your use-case?I would like to know more about your use-case though. I'm mostly surprised and curious.
Have you tested it to get a sense of the slowdown? Or is this speculation? Optimized for valid dataThe length of time that
If one happened to know that their data was incorrect in specific ways, one could re-organize the code to have better average run-time over the invalid data. But in general, I'm not sure that we can know that. Which is to say that, in general, we should not expect invalid data to parse as quickly as valid data (though we can possibly do better). Again, I'm not against the idea, just providing some background. I'd like to see some analysis of the slowdown done before we make this change (perhaps I'll find time for this...maybe...) |
@movermeyer thanks for the fast response. I am working on Optimus https://github.com/ironmussa/Optimus/tree/develop-3.0. Optimus is a library to process and explore big data using pyspark/dask. Because big data in my particular use case I can not know:
I would like to parse string to dates as fast as possible. About the performance, if I try to parse this string to int it will raise and exception and it takes 10x that using valid data. This takes 13-sec approx.
This takes 1.76 sec
In my case, I would need to return a date object if it is a valid date or return the same object if it can not be parsed. |
Please excuse my ignorance. It seems like an odd way to do error handling. I'm surprised that you'd want the same object back, especially since it's just as fast to return |
I need to parse millions of rows and raising exception could slow down the process. Is there any way to return None or just the same object?
The text was updated successfully, but these errors were encountered: