-
Notifications
You must be signed in to change notification settings - Fork 14k
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: dashboard cache invalid join query #11369
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.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #11369 +/- ##
==========================================
- Coverage 65.77% 58.58% -7.19%
==========================================
Files 838 800 -38
Lines 39841 38513 -1328
Branches 3655 3443 -212
==========================================
- Hits 26206 22564 -3642
- Misses 13534 15779 +2245
- Partials 101 170 +69
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
(Slice.id == dashboard_slices.c.slice_id) | ||
& (Slice.datasource_id == datasource_id), |
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.
nit: I think this could be expressed as and_(Slice.id == dashboard_slices.c.slice_id, Slice.datasource_id == datasource_id)
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.
I don't know, I kind of like the bit operator better..
* bugfix: dashboard cache invalid join query * Use engine instead of session
SUMMARY
This fixes a bug where when
DASHBOARD_CACHE
feature flag is enabled, saving datasource will become too slow and sometimes generate the following error:This is because of a wrong join condition where I thought multiple join conditions can be passed to SQLAlchemy's join as consecutive positional arguments, when it's actually expecting only one positional argument for the join conditions.
Also fixes a typo that has made editing datasource unable to update the dashboard cache.
cc @graceguo-supercat @serenajiang
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
DASHBOARD_CACHE
ADDITIONAL INFORMATION