Skip to content

Commit

Permalink
Update query_context_processor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chuancyzhang authored Dec 6, 2021
1 parent 2ae83fa commit 1c5727f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/common/query_context_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ def processing_time_offsets( # pylint: disable=too-many-locals
def get_data(self, df: pd.DataFrame) -> Union[str, List[Dict[str, Any]]]:
if self._query_context.result_format == ChartDataResultFormat.CSV:
include_index = not isinstance(df.index, pd.RangeIndex)
columns = list(df.columns)
verbose_map = self._qc_datasource.data.get("verbose_map", {})
if verbose_map:
df.columns = [verbose_map.get(column, column) for column in columns]
result = csv.df_to_escaped_csv(
df, index=include_index, **config["CSV_EXPORT"]
)
Expand Down

0 comments on commit 1c5727f

Please sign in to comment.