question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Applying `GROUP BY` on `Time-series (Bar) Chart` Omits NULL group values

See original GitHub issue

A clear and concise description of what the bug is.

Expected results

Total counts of stacked bar chart should be the same before/after GROUP BY has been introduced.

Actual results

Total counts of stacked bar chart with GROUP BY applied are wonky and don’t match those without GROUP BY applied. It seems likely that this only occurs when using a GROUP BY on a column where the column’s value could be NULL.

Steps to recreate:

  1. Query:
SELECT 'group1' as test, 10 AS count, CURRENT_DATE() AS date
UNION ALL
SELECT NULL as test, 5 AS count, CURRENT_DATE() AS date
UNION ALL
SELECT 'group3' as test, 5 AS count, CURRENT_DATE() AS date
UNION ALL
SELECT 'group4' as test, 5 AS count, CURRENT_DATE() AS date
  1. Create Time Series Stacked Bar Chart (ECharts) without GROUP BY Screen Shot 2021-07-06 at 5 08 02 PM

  2. Compare with GROUP BY and observe some other weird behavior here where the two stacked colors exclude the 3rd non-null group… Screen Shot 2021-07-06 at 5 08 27 PM

Other Screenshots

Without: Screen Shot 2021-07-06 at 4 57 15 PM

With GROUP BY: Screen Shot 2021-07-06 at 4 47 25 PM

Environment

Not sure. Using Preset.io latest

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • [] I have checked the issue tracker for the same issue and I haven’t found one similar. - Maybe this one is similar? https://github.com/apache/superset/issues/13850

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
andrewscaranicommented, Jul 9, 2021

@junlincc 100% agree to show NULLs. They are a valid category group and without them, data becomes skewed. I would prefer if the new ECharts behaved in the same manner as the existing Bar Charts.

0reactions
andrewscaranicommented, May 2, 2022

Screen Shot 2022-05-02 at 9 44 24 AM It appears that this may have already been fixed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NULL Values and the GROUP BY Clause - LearnSQL.com
In SQL, NULL is a special marker used to indicate that a data value does not exist in the database. For more details,...
Read more >
Build a time-series graph in Grafana - Timescale Docs
This creates the long, straight, almost-horizontal lines you see in the graph. To circumvent this issue, you can use Grafana's Connect null values...
Read more >
pandas.DataFrame.groupby — pandas 1.5.2 documentation
A groupby operation involves some combination of splitting the object, applying a function, and combining the results. This can be used to group...
Read more >
Handling Null and Other Special Values - Tableau Help
The null values will still be included in calculations. The default position depends on the data type. The table below defines the defaults....
Read more >
make-series operator - Azure Data Explorer - Microsoft Learn
This AxisColumn array is also the last output column in the output ... The input rows are arranged into groups having the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found