-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
fix(charts): Fix chart load task error handling #24447
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24447 +/- ##
==========================================
+ Coverage 68.91% 69.00% +0.08%
==========================================
Files 1899 1901 +2
Lines 73843 74002 +159
Branches 8119 8116 -3
==========================================
+ Hits 50892 51067 +175
+ Misses 20840 20824 -16
Partials 2111 2111
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks @giftig. Would you mind adding a unit test as well? This helps both with reviewing the PR and ensures we don't regress in the future. |
@john-bodley yeah I see there's currently no coverage of this task at all; I'll take a look at writing something simple to cover this. |
The exceptions raised within this task are given internationalised messages (flask-babel), which means when the task tries to serialise the exception message to mark the job as failed, it needs to make sure they're rendered first. Cast to str to make that happen. The underlying issue was using lazy_gettext when just using gettext would make more sense, so I've also adjusted the import in a couple of obvious places directly impacting this task to fix it at both ends. I've left in the str cast fix as it'd require a much deeper dive to determine if any other edge cases would still result in a lazy message given the complexity of the task. Add a unit test covering this scenario as the task is currently not covered
I've added a unit test covering the failure scenario specifically using |
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.
LGTM, thanks for the added test here 👍
SUMMARY
The exceptions raised within this task are given internationalised messages (flask-babel), which means when the task tries to serialise the exception message to mark the job as failed, it needs to make sure they're rendered first. Cast to str to make that happen.
The underlying issue was using lazy_gettext when just using gettext would make more sense, so I've also adjusted the import in a couple of obvious places directly impacting this task to fix it at both ends.
I've left in the str cast fix as it'd require a much deeper dive to determine if any other edge cases would still result in a lazy message given the complexity of the task.
TESTING INSTRUCTIONS
See associated issue for full details.
GLOBAL_ASYNC_QUERIES
ADDITIONAL INFORMATION
Fixes #24446