Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New time series charts show all data missing if one part of "contribution" is missing #17020

Closed
3 tasks done
serenajiang opened this issue Oct 7, 2021 · 6 comments
Closed
3 tasks done
Assignees
Labels
#bug Bug report explore:advanced-analysis Related to Advanced Analysis in Explore viz:charts:echarts Related to Echarts

Comments

@serenajiang
Copy link
Contributor

serenajiang commented Oct 7, 2021

When you create a time series viz with a groupby and contribution Total, if at least one of the categories is missing a value for the date, no data points for that date are shown.

This is sort of reasonable - technically, the data could be missing for the missing category, so it is not clear how to calculate contribution. However, in most cases, the missing data point corresponds to the value 0, and removing all the other data points is very confusing. In older charts (ex. line chart), contribution assumes 0 if data is missing, so we should provide some way to "fill" 0 for feature parity.

I think there are two ways

  • Assume 0 whenever data is missing (similar to legacy line chart)
  • Have users use resample to fill missing values with 0. This is not possible yet because resample doesn't work if there's a group by - the error message is: cannot reindex from a duplicate axis and occurs here

How to reproduce the bug

  1. Go to SQL Lab
  2. Run query:
SELECT DATE('2021-09-01') AS ds, 'hi' AS x
UNION ALL SELECT DATE('2021-09-02') AS ds, 'hi' AS x
UNION ALL SELECT DATE('2021-09-01') AS ds, 'whoa' AS x
  1. -> explore chart
  2. Use time series bar chart v2 viz
  3. Group by x, metric count, contribution total
  4. Note the missing data point for (2021-09-02, hi)

Expected results

Two bars should be shown for 09-01, one bar should be shown for 09-02

Actual results

No bars are shown for 09-02, even though there is a data point

image

Environment

(please complete the following information):

  • browser type and version: chrome
  • superset version: up to date with master as of 2021-10-01
  • python version: 3.8

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

This is somewhat related to this issue: #15036

@serenajiang serenajiang added the #bug Bug report label Oct 7, 2021
@serenajiang
Copy link
Contributor Author

@zhaoyongjie Any suggestions on how to proceed?

@serenajiang serenajiang changed the title Time series charts show all data missing if one group by category is missing Time series charts show all data missing if one part of "contribution" is missing Oct 7, 2021
@serenajiang serenajiang changed the title Time series charts show all data missing if one part of "contribution" is missing New time series charts show all data missing if one part of "contribution" is missing Oct 7, 2021
@serenajiang
Copy link
Contributor Author

fyi @junlincc this was one of the asks from our users when giving echarts feedback

@zhaoyongjie
Copy link
Member

@zhaoyongjie Any suggestions on how to proceed?

I will follow up resample operator to support groupby.

@zhaoyongjie zhaoyongjie self-assigned this Oct 8, 2021
@zuzana-vej zuzana-vej added the viz:charts:echarts Related to Echarts label Oct 19, 2021
@zhaoyongjie zhaoyongjie added the explore:advanced-analysis Related to Advanced Analysis in Explore label Oct 23, 2021
@etr2460
Copy link
Member

etr2460 commented Nov 30, 2021

@zhaoyongjie did you get a chance to work on this?

@zhaoyongjie
Copy link
Member

@zhaoyongjie did you get a chance to work on this?

Got it. I will ship it after monorepo project.

@serenajiang
Copy link
Contributor Author

@zhaoyongjie Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report explore:advanced-analysis Related to Advanced Analysis in Explore viz:charts:echarts Related to Echarts
Projects
None yet
Development

No branches or pull requests

5 participants