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.

Time Series viz shows incorrect legend for multiple group by columns

See original GitHub issue

If you use multiple group by columns in the time series viz, the legend shows all permutations of the values rather than just the ones that exist in the data. This is a regression.

Expected results

The legend should only show values for the series in the chart.

Actual results

The legend shows all permutations of column values that are in the chart.

Screenshots

The legend incorrectly shows all permutations of 0 and 1, but the only actual series are (0,0) and (1,1).

image

How to reproduce the bug

  1. Run a query like: SELECT 0 as a, 0 as b, '2021-07-28' as ds UNION SELECT 1 as a, 1 as b, '2021-07-28' as ds
  2. Explore chart. Edit dataset to make ds temporal.
  3. Switch to time series viz. Use metric count(*), group by a and b. Turn on legend.
  4. View incorrect legend.

Environment

(please complete the following information):

  • superset version: superset version up to date with master as of 2021-07-28
  • python version: python --version 3.8.11
  • node.js version: node -v v14.16.1

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.

Additional context

We just started observing this issue in this week’s release, so this regression likely occurred sometime during the last ~10 days.

Unsure whether this was caused by a change in superset-frontend or superset-ui. @zhaoyongjie any thoughts?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
zhaoyongjiecommented, Jul 30, 2021

@serenajiang Thanks for reporting this issue, I file a PR to fix that.

1reaction
zhaoyongjiecommented, Jul 30, 2021

It’s a Pandas pivot_table limitations. https://github.com/pandas-dev/pandas/issues/18030

After filling other value, the pivot_table is unable to do aggregation.

image
Read more comments on GitHub >

github_iconTop Results From Across the Web

greykite.common.viz.timeseries_plotting - LinkedIn Open Source
Source code for greykite.common.viz.timeseries_plotting ... default is based on axis labels. showlegend : `bool`, default True Whether to show the legend.
Read more >
Use multiple columns in a Matplotlib legend - GeeksforGeeks
Use multiple column in a Matplotlib Legend. In many cases, the main thing we may have to encounter that as the legend number...
Read more >
Chart visualization — pandas 1.5.2 documentation - PyData |
A legend will be drawn in each pie plots by default; specify legend=False to hide it.
Read more >
Resolving Forecasting Errors - Tableau Help
Expand the time series in your view to include more date values. This error is returned if there are fewer than four data...
Read more >
Data Visualization – How to Pick the Right Chart Type? - eazyBI
How many variables do you want to show in a single chart? ... Will you display values over a period of time, or...
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