You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/28 16:34:02 UTC

[GitHub] [superset] mbcsa opened a new issue #18218: EXPORT_CSV decimal separator format doesn't work for Decimal MySQL column

mbcsa opened a new issue #18218:
URL: https://github.com/apache/superset/issues/18218


   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
   
   1. Configure superset_config.py with
   
   ```
   CSV_EXPORT = {
       'encoding': 'utf-8',
       'sep': ';',
       'decimal': ','
   }
   ```
   
   2. Create a query with a Decimal(x,y) field, Save and click Explore
   3. In Dataset options, click "Edit Dataset"
   ![image](https://user-images.githubusercontent.com/92950610/151581827-c12e517c-3341-451d-a73d-e9813e834c17.png) 
   4. Verify that decimal column is shown as "NEWDECIMAL"
   ![image](https://user-images.githubusercontent.com/92950610/151580857-234be9d3-080c-4cb3-80d2-c06915553c61.png)
   5. Configure "$,.2f" as format for column
   ![image](https://user-images.githubusercontent.com/92950610/151582272-9b40d371-5229-4dff-ba52-e23cde288773.png)
   4. Save Chart and add to a new Dashboard
   5. Go to Dashboard and Export CSV
   6. Verify that decimal separator is not being formatted as configured in step 1
   ![image](https://user-images.githubusercontent.com/92950610/151582558-cfc76155-1b22-4292-89cc-a716af297533.png)
   
   ### 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: 80f5154d)
   - 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
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org