endimonan opened a new pull request, #44790:
URL: https://github.com/apache/superset/pull/44790

   ### SUMMARY
   
   Graph charts label null source and target categories as `N/A`, merging them 
with a literal `N/A` category in the legend and color assignment. Use the 
existing `NULL_STRING` constant so null categories appear as `<NULL>` and 
remain separate from literal `N/A` values.
   
   Related to #43547. This addresses the Graph category-label case; the issue 
also covers other plugins.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Same saved chart, synthetic dataset, circular layout, and viewport in both 
captures.
   
   **Before:** SQL NULL and literal N/A nodes share one category and color.
   
   ![Graph before: NULL and N/A share a 
category](https://raw.githubusercontent.com/endimonan/superset/dc4115e0f47e6a96a7f01210d2efaecbe0883396/graph-null-before.png)
   
   **After:** SQL NULL nodes have a separate `<NULL>` legend entry and color.
   
   ![Graph after: separate NULL and N/A 
categories](https://raw.githubusercontent.com/endimonan/superset/dc4115e0f47e6a96a7f01210d2efaecbe0883396/graph-null-after.png)
   
   ### TESTING INSTRUCTIONS
   
   Create a virtual dataset from this query (tested with PostgreSQL):
   
   ```sql
   SELECT 'Source: SQL NULL' AS source, 'Target: SQL NULL' AS target,
   CAST(NULL AS VARCHAR) AS source_category,
   CAST(NULL AS VARCHAR) AS target_category, 10 AS weight
   UNION ALL
   SELECT 'Source: literal N/A', 'Target: literal N/A', 'N/A', 'N/A', 20
   UNION ALL
   SELECT 'Source: alpha', 'Target: alpha', 'alpha', 'alpha', 30
   ```
   
   1. Create a Graph chart with `source` and `target` as its node columns, 
`SUM(weight)` as its metric, and the corresponding source/target category 
columns.
   2. Enable the legend and use the circular layout.
   3. Verify three legend entries: `<NULL>`, `N/A`, and `alpha`. Both SQL NULL 
nodes should have the `<NULL>` category and a different color from the literal 
N/A nodes.
   
   Validation:
   
   - The null and undefined regression cases fail before the fix because the 
legend contains only `N/A`.
   - Both Graph Jest suites pass: 14 tests, including boolean/numeric labels 
and charts without categories.
   - `pre-commit run` passes on all three changed files, including targeted 
TypeScript checking.
   - Browser verification confirms identical query rows before/after, separate 
categories/colors, and no page errors.
   
   ```sh
   cd superset-frontend
   npx jest plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts 
plugins/plugin-chart-echarts/test/Graph/buildQuery.test.ts --runInBand
   ```
   
   Local browser validation used a Docker backend and Windows development 
build. A local-only Webpack override disabled `fullySpecified` for the 
installed geostyler dependencies to resolve an existing build error; it is not 
part of this change. The full test suites were not run.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #43547 (Graph category-label portion)
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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