Export to CSV with cached data is converted to Panda Dataframe without column formats #20919
Closed
3 tasks done
Labels
#bug
Bug report
Export to CSV with cached data is converted to Panda Dataframe without column formats.
Then this breaks the usage of CSV_EXPORT option 'sep' (decimal separator).
The first time the data is exported, all works well and decimal separator is respected.
But when the query is executed again during the Cache Timeout, the data is gathered from "results_backend" and a Dataframe is dynamically created. This way, the Dataframe doesn't have column format specifications
It was working fine until merged commit e1fd906
#20760
In file superset/core.py, line dtype=object is setting "object" type for all columns of Dataframe.
When removing line "dtype=object,", the CSV works correctly:
How to reproduce the bug
For Example:
Expected results
Export to CSV to use configured decimal separator, either is using Cached data or not.
Actual results
OK - Export to CSV is using configured decimal separator when data is comming without caching, directly from DB.
FAIL - Expor to CSV is NOT using configured decimal separator when data is comming from "results_backend" CACHE.
Screenshots
Pandas Dataframe when cached
Pandas Dataframe when NOT cached
Environment
Superset 0.0.0dev
"ALERT_REPORTS": True,
"ENABLE_TEMPLATE_PROCESSING": True
Checklist
Make sure to follow these steps before submitting your issue - thank you!
The text was updated successfully, but these errors were encountered: