Skip to content

Scheduled report permalinks do not preserve dashboard dataMask state #39709

@ayush-sharaf

Description

@ayush-sharaf

Bug description

Bug description

Scheduled dashboard reports can store dashboard state under ReportSchedule.extra.dashboard, including native filter state in dataMask.

During report generation, per-tab permalinks are created in superset/commands/report/execute.py. While building those tab-specific permalinks, the existing dashboard state from the report schedule is not preserved.
As a result, dataMask is dropped and scheduled report screenshots may ignore the filter state that was configured on the report schedule.

This is especially visible for scheduled reports that depend on native time filters. Even if the schedule stores the correct date filter state in extra.dashboard.dataMask, the generated permalink does not carry that
state forward, so the rendered report can show incorrect or unfiltered results.

How to reproduce the bug

  1. Create a dashboard with multiple tabs.
  2. Add native filters to the dashboard, including a time filter.
  3. Create a report schedule for that dashboard.
  4. Persist dashboard filter state in ReportSchedule.extra.dashboard.dataMask.
  5. Enable ALERT_REPORT_TABS.
  6. Run report generation for the scheduled dashboard.
  7. Inspect the generated permalink state or the resulting screenshots.

Expected behavior

Scheduled report generation should preserve the parent dashboard state stored in ReportSchedule.extra.dashboard when building per-tab permalinks.

That includes preserving:

  • dataMask
  • activeTabs
  • urlParams

As a result, generated screenshots should reflect the same native filter state stored on the report schedule.

Actual results

Per-tab permalink generation drops stored dashboard state, causing dataMask not to be respected during report execution.

Screenshots/recordings

N/A

Environment

  • Superset version: current master
  • Feature flag: ALERT_REPORT_TABS

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    alert-reportsNamespace | Anything related to the Alert & Reports featuredashboard:native-filtersRelated to the native filters of the Dashboard

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions