Bug description

In mixed charts, query B does not seem to inherit default dashboard-level filters sometimes...

How to reproduce the bug

Hard to reproduce consistently but:

  1. Create a mixed chart with 2 queries, and a primary AND secondary Y-axis.
  2. Primary chart should be a line chart, secondary chart should be a bar chart.
  3. Create a dashboard-level date filter with a default value that is from 2023-11-01 to Now.
  4. Refresh dashboard
  5. Repeat steps 1&2
  6. Refresh dashboard
  7. Notice that query B is not filtered to the default dashboard-level date filter.
  8. Go into edit the chart and notice that query A has automatically added the dashboard-level filter in its filter section: Apache Superset Dashboard-level filters are not applying to charts (that are in-scope)

However, query B does not seem to have inherited the dashboard level filter. Apache Superset Dashboard-level filters are not applying to charts (that are in-scope)

What I expect: All charts are filtered to date ranges from 2023-11-01 to Now. All queries in mixed chart have inherited the dashboard-level filters into its filter section.

What I see: My chart I created after my dashboard filter shows all date ranges (not filtered)

Screenshots/recordings

See above

Superset version

master / latest-dev

Python version

I don't know

Node version

I don't know

Browser

Chrome

Additional context

No response

Checklist

  • [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

Hey @clavidk,

I'm here to help you with your Superset issue. I'm a bot designed to assist you with bugs, questions, and contributions while you wait for a human maintainer. Let's tackle this together!

The issue you're experiencing with dashboard-level filters not applying to some mixed charts (combo line + bar charts with a primary and secondary y-axis) is likely due to the adhoc_filters and adhoc_filters_b parameters having a comparator set to "No filter". This configuration means that the chart is not set up to apply any date range filter by default.

To resolve this, ensure that the comparator values in both adhoc_filters and adhoc_filters_b are set to accept the date range filter from the dashboard. Here is an example configuration:

adhoc_filters:
  - clause: WHERE
    subject: order_date
    operator: TEMPORAL_RANGE
    comparator: No filter
    expressionType: SIMPLE

adhoc_filters_b:
  - clause: WHERE
    subject: order_date
    operator: TEMPORAL_RANGE
    comparator: No filter
    expressionType: SIMPLE

Additionally, the transformProps function in the superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts file handles the transformation of chart properties, including the application of filters. Ensuring that the filterState and queriesData are correctly processed in this function can help in applying the dashboard-level date range filter to mixed charts [1][2].

If the issue persists, you might want to check for any recent updates or changes in the Superset codebase that address the application of dashboard-level filters to mixed charts. Recent updates have improved the dashboard native filter feature, which provides a way to apply and manipulate filters over many charts at the dashboard level, including mixed charts [3][4][5][6].

To continue talking to Dosu, mention @dosu.

Comment From: clavidk

Ah edit: it seems like query B is not inheriting the dashboard level filters: Apache Superset Dashboard-level filters are not applying to charts (that are in-scope) Query B ^ date filter says no filter

Whereas Query A inherits the dashboard filter: Apache Superset Dashboard-level filters are not applying to charts (that are in-scope)

Comment From: mneves24

Same here Screenshot 2024-08-23 at 18 23 08

Comment From: ber-code

+1

Comment From: franzislytics

+1

Comment From: JustGui

The issue is still here on 5.0.0rc1

Comment From: ErikaUsuriaga

+1

Comment From: OOub

+1