-
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: Remove BASE_AXIS from pre-query #29084
fix: Remove BASE_AXIS from pre-query #29084
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #29084 +/- ##
===========================================
+ Coverage 60.48% 83.66% +23.17%
===========================================
Files 1931 518 -1413
Lines 76236 37468 -38768
Branches 8568 0 -8568
===========================================
- Hits 46114 31348 -14766
+ Misses 28017 6120 -21897
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
||
|
||
def get_xaxis_label(columns: list[Column] | None) -> str | None: | ||
def get_x_axis_label(columns: list[Column] | None) -> str | None: |
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.
Renaming for consistency.
def get_base_axis_labels(columns: list[Column] | None) -> tuple[str, ...]: | ||
axis_cols = [ |
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.
Refactoring using shared logic.
(cherry picked from commit 17d7e7e)
(cherry picked from commit 17d7e7e)
(cherry picked from commit 17d7e7e)
(cherry picked from commit 17d7e7e)
(cherry picked from commit 752186a)
SUMMARY
This PR fixes a regression introduced in #21163 where—if enabled—the generic x-axis is incorrectly included in the pre-query (for engines which don’t support JOINs or subqueries) when determining the top-n series.
Specifically, the top-n series are determined for the entire period, i.e., sans the x-axis as a dimension, however within the confines of the generic x-axis said axis is included as a column. This resulted in an explosion of records—via (x, y) pairs—meaning the top-n typically would just be the top-1. The fix is merely to exclude said column when determining the top-n series.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI and tested locally. Sadly writing unit/integration tests for said logic is non-trivial given i) the scale of the
get_sqla_query
function (which is ~ 700 lines of code), and ii) the lack of associated tests.ADDITIONAL INFORMATION