You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Rohit-pawar902 (via GitHub)" <gi...@apache.org> on 2023/02/06 11:04:53 UTC

[GitHub] [superset] Rohit-pawar902 commented on issue #22981: Redundant column problem comes in csv while scheduling in email.

Rohit-pawar902 commented on issue #22981:
URL: https://github.com/apache/superset/issues/22981#issuecomment-1418900752

   ```
   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"]
               )
               return result or ""
   
           return df.to_dict(orient="records")
   ```
   
   I have tracked the issue but I am here stuck that both in the case of
   csv -direct-download
   csv -email
   both execute this function and genrate csv which has no index-colmn because **Include_index** is always false here
   but some-how in case of csv-email from any else method index column is created again
   
   I think while attching in email or while placing file on disk it goes with index-col
   
   But got nothing , **any suggestion realted to this bug**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org