diff --git a/superset/models.py b/superset/models.py index 6f1f720202401..e7e5cda6ac902 100644 --- a/superset/models.py +++ b/superset/models.py @@ -2076,10 +2076,10 @@ def recursive_get_fields(_conf): query_str += json.dumps( client.query_builder.last_query.query_dict, indent=2) df = client.export_pandas() - df.columns = [ - DTTM_ALIAS if c == 'timestamp' else c for c in df.columns] if df is None or df.size == 0: raise Exception(_("No data was returned.")) + df.columns = [ + DTTM_ALIAS if c == 'timestamp' else c for c in df.columns] if ( not is_timeseries and