mistercrunch 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_r138146030
########## 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_EXPORT')['ENCODING']), + sep=str(config.get('CSV_EXPORT')['SEPARATOR'])) else: logging.info("Running a query to turn into CSV") sql = query.select_sql or query.executed_sql df = query.database.get_df(sql, query.schema) # TODO(bkyryliuk): add compression=gzip for big files. - csv = df.to_csv(index=False, encoding='utf-8') + csv = df.to_csv(index=False, encoding=str(config.get('CSV_EXPORT')['ENCODING']), Review comment: Why casting to `str`? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services