-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
input_munger error handling and refactor #2987
Conversation
Hey @Drblessing, thanks for the PR. I love the refactor here. I'm not exactly sure what the Also, Curious on your thoughts here. I may very well be missing something. |
Hey @fselmo thank you for the compliment. I agree with everything you stated. Regarding the TODO, I initially thought wrapping the exception could provide a uniform error handling mechanism for all munger related errors. However, I do see your point about the original exception potentially having a more clear and informative message. Raising a broad TypeError might indeed obscure the specifics of the error and make it harder to debug, and miss other Given these insights, I'd be more than happy to roll back the exception handling change and focus solely on the refactor. Removing the TODO as you suggested also sounds like a clean approach. Would the single-line solution work, assuming it passes the tests?
Let me know if that works for you and I'll make the necessary updates! |
That sounds like a good plan to me 👍🏼. Thanks! |
Thanks again @Drblessing 👍🏼 |
Thank you @fselmo ! 😄 |
What was wrong?
The
input_munger
function had no friendly error output, as well as readability issues and verbose logic. This PR also makes it faster in my local testing. We can reduce theinput_munger
function down to a single line with:if desirable.
How was it fixed?
pipe
themunged_inputs
to afor
loop._munger_star_apply
function.Todo:
Cute Animal Picture