Skip to content

Commit

Permalink
Display all columns if none are specified. (apache#2077)
Browse files Browse the repository at this point in the history
* Display all columns if none are specified.

* Update models.py

* Do not use column for the time series.

* Update models.py

* Update config.py
  • Loading branch information
bkyryliuk authored Feb 1, 2017
1 parent 27aeac6 commit ea8e4ad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
VERSION_STRING = json.load(package_file)['version']

ROW_LIMIT = 50000
VIZ_ROW_LIMIT = 10000
SUPERSET_WORKERS = 2

SUPERSET_WEBSERVER_ADDRESS = '0.0.0.0'
Expand Down
2 changes: 1 addition & 1 deletion superset/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def __init__(self, viz):
}),
'row_limit': (FreeFormSelectField, {
"label": _('Row limit'),
"default": config.get("ROW_LIMIT"),
"default": config.get("VIZ_ROW_LIMIT"),
"choices": self.choicify(
[10, 50, 100, 250, 500, 1000, 5000, 10000, 50000])
}),
Expand Down
6 changes: 6 additions & 0 deletions superset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,12 @@ def query( # sqla
for s in columns:
select_exprs.append(cols[s].sqla_col)
metrics_exprs = []
elif not is_timeseries:
# use all columns if none were specified
for col_obj in cols.values():
select_exprs.append(col_obj.sqla_col)
metrics_exprs = []
row_limit = row_limit or 100

if granularity:

Expand Down
3 changes: 2 additions & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,8 @@ class HistogramViz(BaseViz):
def query_obj(self):
"""Returns the query object for this visualization"""
d = super(HistogramViz, self).query_obj()
d['row_limit'] = self.form_data.get('row_limit', int(config.get('ROW_LIMIT')))
d['row_limit'] = self.form_data.get(
'row_limit', int(config.get('VIZ_ROW_LIMIT')))
numeric_column = self.form_data.get('all_columns_x')
if numeric_column is None:
raise Exception("Must have one numeric column specified")
Expand Down

0 comments on commit ea8e4ad

Please sign in to comment.