You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by gi...@git.apache.org on 2017/09/11 09:02:27 UTC

[GitHub] JulieRossi commented on a change in pull request #3441: config: allow choosing separator character and encoding for csv writing

JulieRossi commented on a change in pull request #3441: config: allow choosing separator character and encoding for csv writing
URL: https://github.com/apache/incubator-superset/pull/3441#discussion_r138015465
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -2126,13 +2126,15 @@ def csv(self, client_id):
             columns = [c['name'] for c in obj['columns']]
             df = pd.DataFrame.from_records(obj['data'], columns=columns)
             logging.info("Using pandas to convert to CSV")
-            csv = df.to_csv(index=False, encoding='utf-8')
+            csv = df.to_csv(index=False, encoding=str(config.get('CSV_ENCODING')),
 
 Review comment:
   To re-cast the string, otherwise I get `TypeError: "delimiter" must be string, not unicode` with python 2.x 
   If you have a better solution, I can change that (or maybe add comment to clarify inside the code ?) 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services