-
Notifications
You must be signed in to change notification settings - Fork 5
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: [MIQ-2130] Fix big chart by adding LIMIT to control panel #265
Conversation
> Previously limit 50000 was automatically added to the query > Now the automatic addition of limit in the query is not allowed
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.
Good thought but we would like it to be configurable
superset/viz.py
Outdated
@@ -1097,6 +1097,7 @@ def query_obj(self): | |||
raise Exception(_('Pick a metric!')) | |||
d['metrics'] = [self.form_data.get('metric')] | |||
self.form_data['metric'] = metric | |||
d['row_limit'] = 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.
Rather than hardcoding that we dont set row_limit we will expose this to user.
https://github.com/Guavus/incubator-superset/blob/fix/MIQ-2130-fix-big-chart-query/superset/assets/src/explore/visTypes.jsx#L1407
https://github.com/Guavus/incubator-superset/blob/fix/MIQ-2130-fix-big-chart-query/superset/assets/src/explore/visTypes.jsx#L1435
we will add a control ['row_limit']
Add a None
or -1
here https://github.com/Guavus/incubator-superset/blob/fix/MIQ-2130-fix-big-chart-query/superset/assets/src/explore/controls.jsx#L98
Override row_limit choices or dafult can be achieved by
https://github.com/Guavus/incubator-superset/blob/fix/MIQ-2130-fix-big-chart-query/superset/assets/src/explore/visTypes.jsx#L289-L298
This should get you going. In case you still need further assistance let me know
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.
Thanks for the references, it helped a lot.
On selection of "-1", LIMIT is removed from the query. I dropped the idea of "None" as the options are getting validated if they are an integer or not; hence raises an error if "None" is there in options.
@@ -95,7 +95,7 @@ const D3_PERCENT_FORMAT_OPTIONS = [ | |||
['.3%', '.3% (12345.432 => 1234543.200%)'], | |||
]; | |||
|
|||
const ROW_LIMIT_OPTIONS = [10, 50, 100, 250, 500, 1000, 5000, 10000, 50000]; | |||
const ROW_LIMIT_OPTIONS = [-1, 10, 50, 100, 250, 500, 1000, 5000, 10000, 50000]; |
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.
As we are not adding handling of -1 in all widgets. we should not modify this array. Instead override options in visTypes.jsx
. the possible way to do is as follow around Line 1422
controlOverrides: {
y_axis_format: {
label: t('Number format'),
},
row_limit: {
default: -1,
choices: formatSelectOptions([-1, ...ROW_LIMIT_OPTIONS]
}
}
...
is js syntax to expand array in-place
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
CATEGORY
Choose one
SUMMARY
Add LIMIT selector in the control panel for BigChart and BigChartTotal charts.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION
REVIEWERS