armgong opened a new issue, #23584:
URL: https://github.com/apache/superset/issues/23584

   A clear and concise description of what the bug is.
   
   #### How to reproduce the bug
   
   1. Go to 'new chart'
   2. Click on 'time series line chart'
   3.  make a new chart with  date type (postgresql) and save
   4.  click on "download "->“download to excel” on the new chart
   5. See error
   `2023-04-05 15:53:44,081:ERROR:superset.views.base:Excel does not support 
datetimes with timezones. Please ensure that datetimes are timezone unaware 
before writing to Excel.   
   
   ### Expected results
   should be export excel with date type colume
   
   ### Actual results
   
   `2023-04-05 15:53:44,081:ERROR:superset.views.base:Excel does not support 
datetimes with timezones. Please ensure that datetimes are timezone unaware 
before writing to Excel.   
   
   ### Environment
   - superset version: `superset 2.1.0`
   - python version: `3.9.13`
   
   ### Additional context
   
   now superset use pandas to export excel files, IMO, maybe we should remove 
timezone info from date types column or convert the column to string for 
success export excel file.
   ``python
   def df_to_excel(df: pd.DataFrame, **kwargs: Any) -> Any:
       output = io.BytesIO()
       # pylint: disable=abstract-class-instantiated
       with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
           df.to_excel(writer, **kwargs)
   
       return output.getvalue()
   ``
   


-- 
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