You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/09/12 18:34:46 UTC

(superset) 01/01: fix(plugin-chart-partition): populate node names in regression test helper

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch fix/partition-chart-icicle-alignment
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 2a3e48c0f299f42301268afa60e647f798da5112
Author: rusackas <ev...@rusackas.com>
AuthorDate: Sat Sep 12 11:34:11 2026 -0700

    fix(plugin-chart-partition): populate node names in regression test helper
    
    The new Partition.test.ts helper populated weight/sum but never set
    `name` (only Icicle's drawVis does that today), so every node in the
    tree came out with `name === undefined`. The `byName` lookup built from
    that then collapsed to a single `undefined` key, and `byName.A1a` was
    undefined in the second test, causing the CI failure.
    
    Co-Authored-By: Evan Rusackas <ev...@preset.io>
    Co-Authored-By: Claude Sonnet 5 <no...@anthropic.com>
---
 .../plugins/plugin-chart-partition/test/Partition.test.ts        | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-partition/test/Partition.test.ts b/superset-frontend/plugins/plugin-chart-partition/test/Partition.test.ts
index a47d0b176f9..9a925162fbc 100644
--- a/superset-frontend/plugins/plugin-chart-partition/test/Partition.test.ts
+++ b/superset-frontend/plugins/plugin-chart-partition/test/Partition.test.ts
@@ -52,9 +52,14 @@ function buildUnevenTree(): PartitionDataNode {
 
 function buildInitializedNodes(data: PartitionDataNode): PartitionNode[] {
   const root = hierarchy<PartitionDataNode>(data) as unknown as PartitionNode;
-  // Populate the weight/sum fields init() relies on, the same way
-  // Icicle's drawVis does before calling init().
+  // Populate the name/weight/sum fields init() relies on, the same way
+  // Icicle's drawVis does before calling init(). Without this, every
+  // node's `name` stays undefined and byName lookups below collapse to a
+  // single key.
   root.eachAfter(n => {
+    n.name = Array.isArray(n.data.name)
+      ? n.data.name[n.data.name.length - 1]
+      : n.data.name;
     n.weight = n.data.val;
   });
   root.eachAfter(n => {