Skip to content

Bug: Drill to Detail / Drill by Not Working Across Charts from Jinja-Based Datasets #35263

Closed

Description

@ShivamYadav0

Bug description

I'm working with three separate datasets, each built using Jinja templating to support dynamic filtering. These datasets are used to power three different charts in a dashboard. All charts share common filter fields (e.g., start_date, Zone, Circle, etc.), and I’ve configured native filters to apply across all charts.

Each dataset uses Jinja to apply filters like this:

SQL query is something like this in all 3 datasets.

WHERE 1=1
{% if filter_values('Zone') %}
AND "Zone" IN {{ filter_values('Zone') | where_in }}
{% endif %}

The charts display correct data when filters are applied. However, when I use Drill to Detail or Drill by on any chart, the resulting detail view shows zero records, even though the chart clearly shows data for the selected value.

Expected Behavior
Drill to Detail should return the filtered rows from the dataset that match the clicked chart element (e.g., Circle = C1, type_of_node = A).

Actual Behavior
Drill to Detail and Drill by return no rows, even though the chart shows non-zero values. This happens consistently across all three charts.

Notes

  1. All datasets use Jinja templating for dynamic filters.

  2. All charts are built from separate datasets, but they share common column names and filter logic.

  3. Native filters are scoped correctly to all charts.

  4. The issue seems to be with how Superset applies drill filters to Jinja-based queries across multiple datasets.

Screenshots/recordings

No response

Superset version

4.1.3

Python version

3.9

Node version

16

Browser

Chrome

Additional context

Image

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • 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.

Activity

  1. dosubot commented on Sep 24, 2025

    @dosubot

    Hi @ShivamYadav0! I'm Dosu and I’m helping the superset team.

    This is a known architectural limitation in Superset 4.1.3: when you use Drill to Detail or Drill by, the drill query only includes chart-level and drill-triggered filters, but does not merge the full dashboard/native filter context. As a result, Jinja-templated datasets that rely on filter_values() for all filters may receive incomplete filter values during drill actions, leading to zero-row results—even when the parent chart shows data for the selected value. This matches your experience and is not specific to your configuration—it's a gap in how drill queries are constructed versus main chart queries (source).

    Recent fixes (after 4.1.3) have addressed some related issues, such as ensuring that drill filters use the original column names instead of verbose labels, which can resolve cases where Drill to Detail returns all or no rows due to filter mismatches (source). However, the core issue—drill queries not merging dashboard/native filters for Jinja-based datasets—remains in 4.1.3.

    Recommended workarounds are to avoid relying on Jinja templating for dynamic filtering in chart queries. Instead, use virtual datasets, SQL CASE WHEN logic, or custom SQL expressions for dynamic behavior (source). If you must use Jinja, ensure your queries have sensible defaults when filters are missing, but be aware this won't fully resolve the drill limitation.

    Upgrading to a newer Superset version may help with some filter propagation issues, but the architectural gap with Jinja and drill actions is still present as of the latest releases.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about superset with Dosu Add Dosu to your team

  2. ShivamYadav0 commented on Sep 24, 2025

    @ShivamYadav0
    Author

    @dosu are there any similar PR or issues?

  3. dosubot commented on Sep 24, 2025

    @dosubot

    Yes, there are several highly relevant issues and PRs in the Superset repository that match your scenario:

    • Issue #33773 describes the same bug: Drill to Detail and Drill by do not work properly on charts powered by Jinja templating because drill queries lack the full dashboard/global filter context, causing Jinja SQL to render with missing values. The suggested workaround is to make your Jinja SQL more robust with if/else blocks, but this doesn't fully solve the context propagation problem.
    • PRs #34694 and #34620 fix related issues where Drill to Detail returned all or no rows due to filter column name mismatches, by mapping axis label filters to original column names before executing the drill query. These help with filter propagation but do not address the Jinja context gap.
    • PR #34319 enabled Drill to Detail and Drill By in embedded mode and with DASHBOARD_RBAC, but does not address Jinja templating or filter propagation in drill queries.

    The core architectural limitation—drill queries not merging dashboard/native filter context for Jinja-based datasets—remains as of the latest releases. You can track the above issue and PRs for updates or further discussion.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about superset with Dosu Add Dosu to your team

  4. sadpandajoe commented on Sep 24, 2025

    @sadpandajoe
    Member

    @ShivamYadav0 can you try on 5.0.0 or 6.0.0rc2 to see if you can repro these same issues? 4.1.X probably won't be supported soon so we're not actively fixing issues on that branch.

  5. rusackas commented on Sep 25, 2025

    @rusackas
    Member

    Yep, let's check on 5/6/master and see if it got fixed anywhere along the way.

  6. Hai6123 commented on Nov 10, 2025

    @Hai6123
    Image

    @rusackas I am using 5.0.0 version but it still have the issues, it is a bit different since I use Jinja in calculated columns for dynamic dimension

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dashboard:drill-downRelated to drill-down functionality of the Dashboardglobal:jinjaRelated to Jinja templatingvalidation:requiredA committer should validate the issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions