-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Labels
Description
A clear and concise description of what the bug is.
How to reproduce the bug
- Go to 'new chart'
- Click on 'time series line chart'
- make a new chart with date type (postgresql) and save
- click on "download "->“download to excel” on the new chart
- 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 in util/excel.py. IMO, maybe we should remove timezone info from date types column or convert the column to string for success export excel file.
``
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()
matheusbsilva