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

Mixed Time-Series Chart: Missing data when toggle "Stack Series" on Query options #21597

Closed
3 tasks done
abifauzann opened this issue Sep 27, 2022 · 4 comments
Closed
3 tasks done
Labels
#bug Bug report

Comments

@abifauzann
Copy link

abifauzann commented Sep 27, 2022

I have created Mixed Time-Series Chart with Bar Chart (in Query A) and Line Chart (in Query B). When I toggle Stack Series option in Query A, the data in Bar chart is not fully updated, which will cause several data is missing in query A. When the Stack Series option is not checked in Query A, we can see the data is rendered as expected.

How to reproduce the bug

  1. Access superset
  2. Create Mixed Time-Series Chart with Public Sales Dataset
  3. Run query as I attach below
  4. Set Chart type in Query A to Bar Chart
  5. Set Chart type in Query B to Line Chart
  6. Toggle "Stack Series" checkbox option in Query A in order to stack several country data

Expected results

It should render stacking country data when we toggle "Stack Series" option in Bar Chart (Query A).

Query A:

SELECT DATE_TRUNC(`order_date`, MONTH) AS `__timestamp`,
       `country` AS `country`,
       sum(`sales`) AS `GMV`
FROM
  (SELECT *
   FROM db.publiccleaned_sales_data) AS `virtual_table`
GROUP BY `country`,
         `__timestamp`
ORDER BY GMV DESC
LIMIT 10000;

Query B:

SELECT DATE_TRUNC(`order_date`, MONTH) AS `__timestamp`,
       sum(`quantity_ordered`) AS `Total_Qty_a2b26`
FROM
  (SELECT *
   FROM db.publiccleaned_sales_data) AS `virtual_table`
GROUP BY `__timestamp`
ORDER BY Total_Qty_a2b26 DESC
LIMIT 10000;

Actual results

There are missing country data when toggle "Stack Series" in Bar Chart (Query A).

Screenshots

Before toggle "Stack Series" option in Query A:
Screen Shot 2022-09-27 at 14 44 05

After toggle "Stack Series" option in Query A:
Screen Shot 2022-09-27 at 14 41 45

Environment

(please complete the following information):

  • browser type and version: Google Chrome Version 105.0.5195.125 (Official Build) (x86_64)
  • superset version: 2.0.0
  • python version: Python 3.8.9
  • node.js version: node 16
  • any feature flags active:

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

Add any other context about the problem here.

@abifauzann abifauzann added the #bug Bug report label Sep 27, 2022
@sfirke
Copy link
Member

sfirke commented Sep 27, 2022

I wonder if this will fix it: #21450 Could you try this on the latest dev to see? That PR and associated bugs are focused on filters with mixed charts, yours isn't about filters but seems close.

@abifauzann
Copy link
Author

I've tried to apply this fix #21450 but the issue still remains the same. I think my issue is close to the toggling "Stack Series" option in Bar Chart and I didn't apply any filtering on Query A or B.

@doornot
Copy link
Contributor

doornot commented Oct 21, 2022

Couldn't reproduce in my local environment (last commit sha: 28c7636)

截屏2022-10-21 下午2 50 04

截屏2022-10-21 下午2 40 31

Query A

SELECT DATETIME(order_date, 'start of month') AS __timestamp,
       country AS country,
       sum(sales) AS "SUM(sales)"
FROM cleaned_sales_data
GROUP BY country,
         DATETIME(order_date, 'start of month')
ORDER BY "SUM(sales)" DESC
LIMIT 10000
OFFSET 0;

Query B

SELECT DATETIME(order_date, 'start of month') AS __timestamp,
       sum(quantity_ordered) AS "SUM(quantity_ordered)"
FROM cleaned_sales_data
GROUP BY DATETIME(order_date, 'start of month')
ORDER BY "SUM(quantity_ordered)" DESC
LIMIT 10000
OFFSET 0;

@ShaliniIruvuru
Copy link

Working as Expected.

Screenshots:

1.Without selecting the Stack Series checkbox
image

2.With Selecting Stack Series Check box.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

5 participants