You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "developer-rpai (via GitHub)" <gi...@apache.org> on 2026/09/19 22:13:23 UTC
[PR] fix(temporary-cache): forward tab_id on DELETE so contextual cache mappings are cleared [superset]
developer-rpai opened a new pull request, #44451:
URL: https://github.com/apache/superset/pull/44451
### SUMMARY
Fixes #44385.
The dashboard filter-state and explore form-data DELETE endpoints built their `CommandParameters` without `tab_id`, while both delete commands (`DeleteFilterStateCommand`, `DeleteFormDataCommand`) build the contextual cache key from `cmd_params.tab_id`. With `tab_id` as `None` at delete time, the command deleted a `cache_key(session_id, None, resource)` mapping that was never written, so the real contextual mapping (`cache_key(session_id, <tab_id>, resource)`) survived the delete. The next create from the same tab then reused the deleted key via the stale mapping.
The fix forwards the `tab_id` query parameter to the delete commands — the same contract POST and PUT already use:
- `superset/temporary_cache/api.py`: `TemporaryCacheRestApi.delete` (covers the dashboard filter-state endpoint) now reads `request.args.get("tab_id")` and passes it through.
- `superset/explore/form_data/api.py`: `ExploreFormDataRestApi.delete` does the same.
No command or schema changes: the commands already expected `tab_id`; only the API layer was not honoring the contract. Both DELETE OpenAPI docstrings now document the `tab_id` query parameter, and `docs/static/resources/openapi.json` was regenerated via `superset update-api-docs` (only the two new parameters were added).
### TESTING INSTRUCTIONS
1. Create filter state with a tab: `POST /api/v1/dashboard/<id>/filter_state?tab_id=1` → key K.
2. Delete it: `DELETE /api/v1/dashboard/<id>/filter_state/K?tab_id=1` → 200.
3. Create again from the same tab: `POST ...?tab_id=1` → must return a fresh key, not K. (Before the fix it returned K.) Same flow for `POST/DELETE /api/v1/explore/form_data?tab_id=1`.
New unit regression tests (fail on pristine code, pass with the fix):
- `tests/unit_tests/dashboards/filter_state_api_test.py::test_delete_forwards_tab_id_and_clears_contextual_mapping`
- `tests/unit_tests/explore/form_data_api_test.py::test_delete_forwards_tab_id_and_clears_contextual_mapping`
Local runs: the two test files (5 tests) pass; the wider `tests/unit_tests/dashboards`, `tests/unit_tests/explore`, `tests/unit_tests/commands/dashboard`, `tests/unit_tests/commands/explore`, and `temporary_cache_create_test.py` suites (293 tests) pass; `ruff check` and `ruff format --check` are clean on all changed files. The full integration suites for these endpoints were not run locally (they need the example-data environment); CI is authoritative there.
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #44385
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(temporary-cache): forward tab_id on DELETE so contextual cache mappings are cleared [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #44451:
URL: https://github.com/apache/superset/pull/44451#issuecomment-5745692614
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 0f12e3a302c7acba038ce72e56893bbb095699c9 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6aaf09030a788b0008b52451 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-44451--superset-docs-preview.netlify.app](https://deploy-preview-44451--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcoxDoAgDADAv3S2SVVQ9Ac-oxWIJCiEMGiMf5fthnshl3TmCitAB1L42o9mH260LrrqsLJgsKjUaHQr1uWYns22NDF7Wmgkno0RIjKiB6V7-H4) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-44451--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(temporary-cache): forward tab_id on DELETE so contextual cache mappings are cleared [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #44451:
URL: https://github.com/apache/superset/pull/44451
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(temporary-cache): forward tab_id on DELETE so contextual cache mappings are cleared [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44451:
URL: https://github.com/apache/superset/pull/44451#issuecomment-5745712651
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44451?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `4 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 57.31%. Comparing base ([`43fee87`](https://app.codecov.io/gh/apache/superset/commit/43fee87672297d2217ad297b1e80042a4358074b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0f12e3a`](https://app.codecov.io/gh/apache/superset/commit/0f12e3a302c7acba038ce72e56893bbb095699c9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/44451?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [superset/explore/form\_data/api.py](https://app.codecov.io/gh/apache/superset/pull/44451?src=pr&el=tree&filepath=superset%2Fexplore%2Fform_data%2Fapi.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZXhwbG9yZS9mb3JtX2RhdGEvYXBpLnB5) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [superset/temporary\_cache/api.py](https://app.codecov.io/gh/apache/superset/pull/44451?src=pr&el=tree&filepath=superset%2Ftemporary_cache%2Fapi.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdGVtcG9yYXJ5X2NhY2hlL2FwaS5weQ==) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (43fee87) and HEAD (0f12e3a). Click for more details.
>
> <details><summary>HEAD has 102 uploads less than BASE</summary>
>
>| Flag | BASE (43fee87) | HEAD (0f12e3a) |
>|------|------|------|
>|python|89|1|
>|presto|15|1|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #44451 +/- ##
===========================================
- Coverage 80.65% 57.31% -23.34%
===========================================
Files 2942 2942
Lines 175692 175694 +2
Branches 40788 40788
===========================================
- Hits 141705 100705 -41000
- Misses 31325 74029 +42704
+ Partials 2662 960 -1702
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.03% <0.00%> (-0.01%)` | :arrow_down: |
| [python](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.03% <0.00%> (-45.93%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/44451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44451?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(temporary-cache): forward tab_id on DELETE so contextual cache mappings are cleared [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44451:
URL: https://github.com/apache/superset/pull/44451#issuecomment-5745677890
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org