Copilot commented on code in PR #31477:
URL: https://github.com/apache/superset/pull/31477#discussion_r2194367820


##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/treeBuilder.ts:
##########
@@ -74,9 +76,12 @@ export function treeBuilder(
               0,
             )
           : metricValue;
+        const validChildren = filterNullNames
+          ? children.filter(child => child.name !== null)
+          : children;
         result.push({
           name,
-          children,
+          children: validChildren,

Review Comment:
   When `filterNullNames` is true and every child is null, the parent node will 
have an empty `children` array but still be included. You may want to drop 
parent nodes that end up with no valid children to avoid empty branches in the 
final tree.



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