lisa-saunders opened a new issue, #36113:
URL: https://github.com/apache/superset/issues/36113

   ### Bug description
   
   We are using the `ROUND()` function in metric definitions to round the 
result of an aggregation.
   
   Since upgrading to version `6.0.0rc2`, Superset will now `CAST` as `FLOAT` 
before applying the `ROUND`, leading to an unexpected result.
   Here's an example, assuming the following metric definition:
   `ROUND(AVG(0.949583),4)`
   
   Running the query in Redshift, this leads to the value `0.9496`
   
   The query Superset is running is:
   `ROUND(CAST(AVG(0.949583) AS DECIMAL), 4)`
   
   Which returns `1` since the value is first rounded by the CAST
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.11
   
   ### Node version
   
   I don't know
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   None
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to