squalou commented on code in PR #23476:
URL: https://github.com/apache/superset/pull/23476#discussion_r1158873705


##########
superset/common/query_context_processor.py:
##########
@@ -461,7 +464,17 @@ def get_data(self, df: pd.DataFrame) -> Union[str, 
List[Dict[str, Any]]]:
                     df, index=include_index, **config["CSV_EXPORT"]
                 )
             elif self._query_context.result_format == 
ChartDataResultFormat.XLSX:
-                result = excel.df_to_excel(df, **config["EXCEL_EXPORT"])
+                ndf = df.copy()
+                columns = list(df)
+                i = 0
+                for col in columns:
+                    coltype = None
+                    if i < len(coltypes):
+                        coltype = coltypes[i]
+                        if coltype == GenericDataType.NUMERIC:
+                            ndf[col] = pd.to_numeric(df[col], errors="ignore")

Review Comment:
   I wondered, and from some manual tests with libreoffice and excel, I got 
better result leaving things as is. But of course it would require much more 
testing (with timezones and locales and what not), things I cannot do. 
   
   Leaving this for other volunteers would suit me to be honest ;)
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to