-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat: add global max row limit #16683
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
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.
Instead of adding yet another sql limit, shouldn't we be using SQL_MAX_ROW
to limit the max rows, regardless of what the user provides?
@etr2460 well, I did remove one, so the change is net neutral 😄 Joking aside, that's not a bad idea - so should we apply |
@villebro I'm a fan of that approach personally, I think it's how it's actually supposed to work |
Perfect, I'll update accordingly! |
c1de713
to
dac8dfa
Compare
dac8dfa
to
095fb8c
Compare
superset/utils/core.py
Outdated
@@ -1762,3 +1762,29 @@ def parse_boolean_string(bool_str: Optional[str]) -> bool: | |||
return bool(strtobool(bool_str.lower())) | |||
except ValueError: | |||
return False | |||
|
|||
|
|||
def apply_max_row_limit(max_limit: Optional[int], limit: int) -> int: |
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.
instead of needing to pass in the max row limit, should we access the config value here? Seems like the first argument is always set to the same thing where this function is used
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.
You know you're absolutely right, this current sig is really an artifact from earlier iterations of this PR. Will update accordingly 👍
05a6759
to
203c6cf
Compare
Codecov Report
@@ Coverage Diff @@
## master #16683 +/- ##
==========================================
- Coverage 76.97% 76.76% -0.21%
==========================================
Files 1007 1007
Lines 54163 54168 +5
Branches 7463 7374 -89
==========================================
- Hits 41690 41582 -108
- Misses 12233 12346 +113
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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
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 iterating and the tests!
* feat: add global max limit * fix lint and tests * leave SAMPLES_ROW_LIMIT unchanged * fix sample rowcount test * replace max global limit with existing sql max row limit * fix test * make max_limit optional in util * improve comments (cherry picked from commit 4e3d4f6)
* feat: add global max limit * fix lint and tests * leave SAMPLES_ROW_LIMIT unchanged * fix sample rowcount test * replace max global limit with existing sql max row limit * fix test * make max_limit optional in util * improve comments
* feat: add global max limit * fix lint and tests * leave SAMPLES_ROW_LIMIT unchanged * fix sample rowcount test * replace max global limit with existing sql max row limit * fix test * make max_limit optional in util * improve comments
in https://domain.com/api/v1/dashboard/7/datasets I was getting a type mismatch error. I have no idea if there's something wrong with my config, or if the particular usage of the function through this api call was bad. |
SUMMARY
Assume
SQL_MAX_ROW
as the global maximum row count for the following queries:In addition, the old
VIZ_ROW_LIMIT
parameter is removed, as it has been replaced byROW_LIMIT
everywhere else except in the histogram chart, hence is not really used any longer.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION