bito-code-review[bot] commented on PR #41182:
URL: https://github.com/apache/superset/pull/41182#issuecomment-4737607630

   <!-- Bito Reply -->
   The flagged issue is correct. Returning raw strings from `parseMetricValue` 
breaks downstream numeric calculations, such as trendline aggregation and 
percentage change, which expect numeric values and will result in `NaN` when 
encountering strings. To resolve this, `parseMetricValue` should continue 
returning `null` for non-date strings in shared paths, and string preservation 
should be handled explicitly only where needed (e.g., in the Big Number Total 
path).
   
   Here is the corrected implementation for 
`superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts`:
   
   ```typescript
       if (dateObject.isValid()) {
         return dateObject.valueOf();
       }
       return null;
     }
     return metricValue;
   };
   ```
   
   There are no other comments in the provided review data to address. Would 
you like me to check for any other potential issues in this file?
   
   **superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts**
   ```
   if (dateObject.isValid()) {
         return dateObject.valueOf();
       }
       return null;
     }
     return metricValue;
   };
   ```


-- 
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