apache / apache/superset

Ignore cache when generating report” does not propagate `force` to `/api/v1/chart/data` for dashboard reports (cached results still used)

Open
#38,672 1 comment 0 reactions 0 assignees View on GitHub
alert-reports api:charts
Dominant language
Python
Stars
74.8k
Forks
18.3k
Avg merge
2d 5h
Merged PRs (30d)
685

Description

### Bug description

When scheduling a **dashboard** report (PNG/PDF) and enabling **“Ignore cache when generating report”**, Superset still serves **cached** chart results.

From the webserver access logs, the report execution loads the dashboard and requests chart data via `/api/v1/chart/data`, but **no `force=true` (or `force=1`) is included** in the chart-data request, so the cache is not bypassed.

In contrast, for **chart reports** (PNG/PDF/CSV) with the same setting enabled, we do see `force=true` propagated to `/api/v1/chart/data`, which correctly bypasses cache (and in our test environment leads to a datasource error because the query actually runs).

This suggests that the `force` flag is correctly propagated in the **chart report / Explore flow**, but not in the **dashboard report flow**.

---

## Expected behavior
With **“Ignore cache when generating report”** enabled:

- Dashboard reports should fetch chart data with `force=true` (or equivalent) and bypass the data cache.
- The generated dashboard report should reflect fresh datasource results, not cached values.

---

## Actual behavior
- Dashboard reports still use cached results.
- Webserver access logs show `/api/v1/chart/data` requests **without `force`**, even though “Ignore cache…” is enabled.

Example from dashboard report run:

```
POST /api/v1/chart/data?form_data=...&dashboard_id=9 200
```

No `force=true` is present.

Example from chart/explore run:

```
POST /api/v1/chart/data?form_data=...&force=true 400
```

Here the query **does bypass cache** and hits the datasource.

---

## Reproduction steps

1. Configure Redis caching for Superset chart results (`DATA_CACHE_CONFIG`) with a noticeable TTL (e.g. several hours).
2. Create a **dashboard** containing at least one chart that queries a datasource.
3. Load the dashboard once so the chart results are **cached**.
4. Create a **scheduled report** for the dashboard (PNG or PDF).
5. Enable **“Ignore cache when generating report”** in the report configuration.
6. Execute the report once to confirm it works normally.
7. **Remove access to the underlying data** for the report execution user (in our case by revoking Lake Formation access / removing RBAC tag on the table).
- This step ensures that **cached results would still work**, but **fresh queries should fail**.
8. Execute the scheduled **dashboard report again**.

Observe:

- The dashboard report **still succeeds** because cached results are used.
- Server logs show `/api/v1/chart/data` without `force`.

Now compare with a **chart report**:

9. Create a scheduled report for the **chart** (PNG/PDF/CSV) with **Ignore cache enabled**.
10. Execute the chart report again after access was removed.

Observe:

- The chart report **fails** because it bypasses cache and actually queries the datasource.
- Server logs show:

```
POST /api/v1/chart/data?...&force=true
```

which triggers a datasource error (expected in this test scenario).

---

## Evidence from logs

### Dashboard report run

Dashboard loaded without `force`:

```
GET /superset/dashboard//?permalink_key=&standalone=3 200
```

Chart data fetched without `force`:

```
POST /api/v1/chart/data?form_data=...&dashboard_id=9 200
```

---

### Chart report run

Explore page loaded with `force`:

```
GET /explore/?form_data=...&force=true&standalone=true 200
```

Chart data fetched with `force=true`:

```
POST /api/v1/chart/data?form_data=...&force=true 400
```

Datasource query executed and failed (Athena):

```
pyathena.error.OperationalError: TABLE_NOT_FOUND
```

This confirms that **cache bypass works correctly for chart reports**.

### Screenshots/recordings

Not available at the moment.
The behavior is demonstrated via server access logs and report execution results.

### Superset version

6.0.0

### Python version

3.10

### Node version

Not applicable

### 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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the dashboard scheduled-report flow from the dashboard page request to POST /api/v1/chart/data, then compare it with the chart-report/Explore flow that already propagates force=true. Done means dashboard reports with “Ignore cache when generating report” send force=true (or an equivalent cache-bypass signal) and use fresh datasource results rather than cached values.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, redis
Domain
api, backend, data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.