vhogberg opened a new issue, #43547: URL: https://github.com/apache/superset/issues/43547
### Bug description **NULL values are visualized inconsistently across different plugins, which can be misleading for users.** There are three main inconsistencies, listed in order of severity, in my opinion: 1. NULL value dimensions are not shown in certain charts 2. NULL_STRING is not shown next to NULL value dimensions in certain charts 3. NULL_STRING is not shown in tooltips for NULL value dimensions in certain charts Perhaps these are three separate bugs with three separate fixes, but I wanted to report it in one sweep as general NULL visualization issues. **1. NULL value dimensions are not shown in certain charts** In certain charts, NULL value dimensions are not shown entirely. I've spotted this when comparing a box plot and bar chart using the same dataset and configuration, notice 7 boxes vs 8 bars: <img width="1079" height="665" alt="Image" src="https://github.com/user-attachments/assets/72ed26b6-a02c-453c-98bb-634b35dc821d" /> <img width="1110" height="669" alt="Image" src="https://github.com/user-attachments/assets/3f50bf14-db76-4973-817b-b1c4942623b2" /> Histograms seem to have the same issue. I think it's because `aggregate.py `calls `df.groupby(by=groupby)` without `dropna=False`. Pandas defaults to dropping NaN keys, so the whole group vanishes before it reaches the frontend. **2. NULL_STRING is not shown next to NULL value dimensions in certain charts** NULL_STRING is not shown next to NULL value dimensions in certain charts, I've spotted it in Chord diagrams, graph charts, and partition charts. Here's an example of it in a chord diagram, the biggest dimension is NULL, but it's not possible to tell as NULL_STRING is omitted: <img width="695" height="460" alt="Image" src="https://github.com/user-attachments/assets/2c34b971-4dbe-43b4-a6d9-bb0830c6eb4b" /> For Graph, it seems transformProps returns the literal 'N/A' for null categories instead of NULL_STRING. **3. NULL_STRING is not shown in tooltips for NULL value dimensions in certain charts** Here's an example of a NULL value dimension for a bubble chart, the tooltip does not have NULL_STRING in the tooltip title: <img width="699" height="451" alt="Image" src="https://github.com/user-attachments/assets/d53e9373-be53-49e2-adfe-e2303c424a46" /> I have spotted this same issue in Radar charts and Treemap charts, though it could be visible in more. **To reproduce** 1. Use a virtual dataset with NULL dimensions via SQL lab, such as: ``` SELECT 'alpha' AS category, 10 AS value UNION ALL SELECT 'alpha', 20 UNION ALL SELECT 'alpha', 35 UNION ALL SELECT 'beta', 15 UNION ALL SELECT 'beta', 25 UNION ALL SELECT 'beta', 40 UNION ALL SELECT NULL, 12 UNION ALL SELECT NULL, 22 UNION ALL SELECT NULL, 38 ``` 2. Configure category as the dimension and reproduce see the different issues across the different chart types. I use postgres as the DB, fyi. **Thoughts** How null representation is defined is also scattered, refactor and consolidate a single null constant + formatter into @superset-ui/core, and pass dropna=False in postprocessing for issue 1. ### Screenshots/recordings _No response_ ### Superset version 6.1.0 ### Python version 3.11 ### Node version 16 ### Browser Chrome ### Additional context _No response_ ### Checklist - [x] I have searched Superset docs and Slack and didn't find a solution to my problem. - [x] I have searched the GitHub issue tracker and didn't find a similar bug report. - [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section. -- 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]
