-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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(warm_up_cache): JSON serialization #23569
fix(warm_up_cache): JSON serialization #23569
Conversation
@mock.patch.object(ChartDataCommand, "run") | ||
def test_warm_up_cache_error(self, run_mock) -> None: | ||
self.login() | ||
slc = self.get_slice("Pivot Table v2", db.session) |
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.
Another sad byproduct of having multiple ways of doing things. The Empty query?
is handled differently depending on whether or not the slice has a query context defined as it seems other paths wont raise, i.e., it seems like only the ChartDataCommand
exception will contain the LazyString
whereas the others have likely been stringified via the str(...)
function.
Codecov Report
@@ Coverage Diff @@
## master #23569 +/- ##
===========================================
- Coverage 68.24% 57.07% -11.17%
===========================================
Files 1956 1956
Lines 75589 75589
Branches 8223 8223
===========================================
- Hits 51582 43144 -8438
- Misses 21899 30337 +8438
Partials 2108 2108
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 304 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
ebe555e
to
1e00f46
Compare
I tried this patch with superset 2.1.0, unfortunately it didn't help, legacy charts don't properly show error message, endlessly showing loading gif, whereas worker show this in its log:
|
Closing in favor of #24671. |
SUMMARY
A byproduct of #23012, when warming a non-legacy chart it's valid for the error to be a babel form of
Empty query?
which is not JSON serializable, i.e.,json.dumps(...)
raises the following error:The fix to to use the the
base_json_conv
serialization method. Havingjson.dump(...)
splattered throughout the code is rather unfortunate as there's no consistency in how payload are serialized. Ideally exceptions should be raised and handled in a uniform way per SIP-41.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Added unit test.
ADDITIONAL INFORMATION