-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Closed
Copy link
Labels
#bugBug reportBug reportvalidation:validatedA committer has validated / submitted the issue or it was reported by multiple usersA committer has validated / submitted the issue or it was reported by multiple users
Description
Description
"Export to CSV" does not respect EXPORT_CSV decimal separator option for a MySQL Decimal(x,y) column. I see that column is mapped as NEWDECIMAL.
To make it work I have to CAST to FLOAT on SQL query. Then it's mapped as FLOAT and respects decimal separator as configured.
How to reproduce the bug
- Configure superset_config.py with
CSV_EXPORT = {
'encoding': 'utf-8',
'sep': ';',
'decimal': ','
}
- Create a query with a Decimal(x,y) field, Save and click Explore
- In Dataset options, click "Edit Dataset"

- Verify that decimal column is shown as "NEWDECIMAL"

- Configure "$,.2f" as format for column

- Save Chart and add to a new Dashboard
- Go to Dashboard and Export CSV
- Verify that decimal separator is not being formatted as configured in step 1

Expected results
Export CSV Option USES configured decimal separator when Datasource Column has as Decimal data type in a MySQL Datasource
Actual results
Export CSV Option DOES NOT use configured decimal separator when a Datasource Column has as Decimal data type in a MySQL Datasource
Environment
- browser type and version: User-Agent | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0
- superset version: Superset 0.0.0dev (SHA: 80f5154)
- python version: Python 3.9.5
- node.js version: v14.18.3
- any feature flags active:
FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"ENABLE_TEMPLATE_PROCESSING": True
}
- Datasource MySQL version: mariadb-10.5.9
Checklist
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven't found one similar.
frheinze and fyod0r1
Metadata
Metadata
Assignees
Labels
#bugBug reportBug reportvalidation:validatedA committer has validated / submitted the issue or it was reported by multiple usersA committer has validated / submitted the issue or it was reported by multiple users