diff --git a/superset/config.py b/superset/config.py index b686b988f..4a32b2c5d 100644 --- a/superset/config.py +++ b/superset/config.py @@ -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' diff --git a/superset/forms.py b/superset/forms.py index 0a1dcb45d..150c0b709 100755 --- a/superset/forms.py +++ b/superset/forms.py @@ -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]) }), diff --git a/superset/models.py b/superset/models.py index aefdfe617..9a4d18121 100644 --- a/superset/models.py +++ b/superset/models.py @@ -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: diff --git a/superset/viz.py b/superset/viz.py index e0c8ac8cd..1fe04a75f 100755 --- a/superset/viz.py +++ b/superset/viz.py @@ -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")