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

   <!-- Bito Reply -->
   The observation regarding `Date` object identity in `Map` keys is correct. 
Since `Map` uses strict equality (`===`), two distinct `Date` instances with 
the same timestamp will be treated as different keys, leading to incorrect 
grouping. To resolve this, you should canonicalize `Date` objects into their 
primitive timestamp values (e.g., `date.getTime()`) before using them as keys 
in the `groupByValue` function.
   
   **superset-frontend/plugins/plugin-chart-echarts/src/utils/treeBuilder.ts**
   ```
   const key = datum[groupByKey];
       const canonicalKey = key instanceof Date ? key.getTime() : key;
       const group = groups.get(canonicalKey);
   ```


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