-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: improve misleading warning for progress callback exceptions #775
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
base: main
Are you sure you want to change the base?
fix: improve misleading warning for progress callback exceptions #775
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for working on this!
There are some suggestion would be good to address before merging:
- please can you add tests
- replace use of try-except-else to make it consistent in the project
Hi @ihrpr thank you for the review. I'll add the tests. |
Hi @ihrpr, ready for another pass! |
Why is it misleading? Do you have a MRE that I can check this locally? Also, if this makes sense, we should except on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding tests! Few things to address - please see comments in PR
- As Kludex pointed out, the PR catches
Exception
which is too broad. - The warning could include more context about which progress token/request triggered the exception.
Thank you for your reviews and comments @Kludex and @ihrpr! @Kludex the "misleading" part is that it prints |
@ihrpr can you take another look? |
…/basil/expand_meta_name_reservation expand `_meta` name reservation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lorenzocesconetto - thank you for your contribution!
Apologies for the time it took to get back to this - would you be able to update the PR to ensure tests pass and merge conflicts are resolved?
Happy to get back to this quickly if you have the bandwidth to update this PR!
Hi @felixweinberger, thanks for getting back to me, I'll update this PR. |
Thank you for the feedback and yes it's something we're currently working on the team to improve coverage for (so we can get back to people more quickly). I'll be sure to get back to you quickly on this PR. Thank you for the offer of making more contributions! I'm currently trying to get a handle on clusters of issues on the python SDK worth prioritizing, I'll let you know if I find something suitable that needs some help! |
…ix-callback-exception-warning
@felixweinberger pulled the latest changes and resolved the conflicts. |
Thanks! There is occasional flakiness in the tests, I restarted it let's see if it was one of those. |
except Exception as e: | ||
logging.error( | ||
"Progress callback raised an exception: %s", | ||
e, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an outer exception block 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair - how would you propose addressing the misleading part here instead? The callback could be anything, so it could throw any kind of exception.
We could potentially replace 410 to just be a generic logging.exception(e)
without any additional decoration? In order to be more broad without adding misleading commentary?
Currently if the progress notification callback throws an exception we get a misleading warning message.
This PR aims to fix it.
Motivation and Context
How Has This Been Tested?
Ran a few tests locally.
Breaking Changes
No breaking changes.
Types of changes
Checklist
Additional context