Display all columns if none are specified. (#2077)
* Display all columns if none are specified. * Update models.py * Do not use column for the time series. * Update models.py * Update config.py
This commit is contained in:
parent
27aeac6859
commit
ea8e4ad05b
|
|
@ -30,6 +30,7 @@ with open(PACKAGE_FILE) as package_file:
|
|||
VERSION_STRING = json.load(package_file)['version']
|
||||
|
||||
ROW_LIMIT = 50000
|
||||
VIZ_ROW_LIMIT = 10000
|
||||
SUPERSET_WORKERS = 2
|
||||
|
||||
SUPERSET_WEBSERVER_ADDRESS = '0.0.0.0'
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ class FormFactory(object):
|
|||
}),
|
||||
'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])
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -1320,6 +1320,12 @@ class SqlaTable(Model, Queryable, AuditMixinNullable, ImportMixin):
|
|||
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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue