def transform(self, dataframe, display_schema):
csv_df = self._format_columns(dataframe, display_schema['metrics'], display_schema['dimensions'])
if isinstance(dataframe.index, pd.RangeIndex):
# If there are no dimensions, just serialize to csv without the index
return csv_df.to_csv(index=False)
csv_df = self._format_index(csv_df, display_schema['dimensions'])
row_dimension_labels = self._format_row_dimension_labels(display_schema['dimensions'])
return csv_df.to_csv(index_label=row_dimension_labels)
评论列表
文章目录