You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
The text was updated successfully, but these errors were encountered:
I've seen this with specifically the datetime with timezone column type. The CSV export works and casting the column to a datetime without timezone also works as a workaround
A clear and concise description of what the bug is.
How to reproduce the bug
`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 2.1.0
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()
The text was updated successfully, but these errors were encountered: