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

BUG: Dashboard filters "stick" to second part of Mixed Chart #20961

Closed
3 tasks done
sfirke opened this issue Aug 3, 2022 · 6 comments
Closed
3 tasks done

BUG: Dashboard filters "stick" to second part of Mixed Chart #20961

sfirke opened this issue Aug 3, 2022 · 6 comments
Labels
#bug Bug report

Comments

@sfirke
Copy link
Member

sfirke commented Aug 3, 2022

My mixed chart (with stacked bars and a five year rolling total line) on a dashboard starts off correct, but after some filtering on the dashboard, the filter conditions persist only with the rolling total line (Query B).

Here's the current state of the dashboard - see no filters applied and I've removed the filter related to bicycles:
image

Note that the Five Year Rolling Average line is way at the bottom, that's the problem due to the incorrectly-persisted filtering.

Then I click View Query and can see that the correct filtering is applied to the stacked bars (Query A) but a lot of previous filtering is also applying to the rolling line, Query B:

Query A SQL

SELECT TOP 10000 DATEADD(YEAR, DATEDIFF(YEAR, 0, [CrashDate]), 0) AS [CrashDate],
           [GretInjSev] AS [GretInjSev],
           COUNT(*) AS count
FROM dbo.[RoadsoftCrashes]
WHERE [GretInjSev] IN (1,
                       2,
                       3,
                       4,
                       5)
  AND [NFC] IN (N'3',
                 N' 4',
                  N' 5',
                   N'6',
                    N'7')
GROUP BY DATEADD(YEAR, DATEDIFF(YEAR, 0, [CrashDate]), 0),
         [GretInjSev]
ORDER BY count DESC;

Query B SQL - Lots of extra filtering incl. a repeated filter and the bicycle filter which I've since deleted:

SELECT TOP 10000 DATEADD(YEAR, DATEDIFF(YEAR, 0, [CrashDate]), 0) AS [CrashDate],
           COUNT(*) AS count
FROM dbo.[RoadsoftCrashes]
WHERE [GretInjSev] IN (1,
                       2,
                       3,
                       4,
                       5)
  AND [NFC] IN (N'3',
                 N'4',
                  N'5',
                   N'6',
                    N'7')
  AND [GretInjSev] IN (1,
                       2,
                       3,
                       4,
                       5)
  AND [GretInjSev] IN (1,
                       2,
                       3,
                       4,
                       5)
  AND [Bicycle] IN (1)
  AND [GretInjSev] IN (1,
                       2,
                       3,
                       4,
                       5)
GROUP BY DATEADD(YEAR, DATEDIFF(YEAR, 0, [CrashDate]), 0)
ORDER BY count DESC;

That's confirmed when I click Edit Chart and see two different sets of filters applied:
image

vs.
image

Environment

(please complete the following information):

  • Firefox
  • superset version: 2.0.0
  • any feature flags active: ALERT_REPORTS, ENABLE_SCHEDULED_EMAIL_REPORTS, DASHBOARD_RBAC, GENERIC_CHART_AXES, EMAIL_NOTIFICATIONS

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.
@sfirke sfirke added the #bug Bug report label Aug 3, 2022
@sfirke sfirke changed the title Dashboard filters "stick" to second part of Mixed Chart BUG: Dashboard filters "stick" to second part of Mixed Chart Aug 3, 2022
@sfirke
Copy link
Member Author

sfirke commented Aug 3, 2022

I was able to reproduce this with the example data set flights. Here's the dashboard with the filters in errored state:
image

When I click View Query I see the persisted filters on Query B did not release when I un-checked them:
Query A

SELECT "DAY" AS "DAY",
       "STATE" AS "STATE",
       COUNT(*) AS count
FROM public.flights
WHERE "STATE" IN ('CA',
                  'IL',
                  'NY')
GROUP BY "DAY",
         "STATE"
ORDER BY count DESC
LIMIT 10000;

Query B

SELECT "DAY" AS "DAY",
       COUNT(*) AS count
FROM public.flights
WHERE "STATE" IN ('CA',
                  'IL',
                  'NY')
  AND "AIRLINE" IN ('EV')
  AND "COUNTRY_DEST" IN ('USA')
GROUP BY "DAY"
ORDER BY count DESC
LIMIT 10000;

@sfirke
Copy link
Member Author

sfirke commented Aug 3, 2022

Seems like it could be related to #20952

@baguskna
Copy link

Hi, is there any follow up for this? We have replicated the same issue in our project. Look forward to find the fix

@rusackas
Copy link
Member

I think #21114 plays a big role here, can you see if that improves the situation? CC @kgabryje

@kgabryje
Copy link
Member

kgabryje commented Sep 20, 2022

It should have been fixed by #21450 (CC @villebro). Closing, but we can reopen if problem persists

@sfirke
Copy link
Member Author

sfirke commented Sep 20, 2022

Yep #21450 looks promising as a fix, thank you! Any chance this could make it into the 2.0.1 release? I just added a comment on that discussion thread requesting it. EDIT I see it is being included there, FYI to others.

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

4 participants