You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/08/10 01:59:06 UTC
[PR] docs(cache): document native filter option cache warm-up strategy [superset]
rusackas opened a new pull request, #42953:
URL: https://github.com/apache/superset/pull/42953
### SUMMARY
#41531 added `NativeFilterOptionsStrategy`, a cache warm-up strategy for native filter dropdown option queries, along with the `SUPERSET_CACHE_WARMUP_USER`/strategy registry config. That PR didn't touch `docs/admin_docs/configuration/cache.mdx`, so the new `native_filter_options` strategy is undocumented next to the existing warm-up strategy docs (`top_n_dashboards`, etc).
This adds a "Warming Up Native Filter Options" section under the existing "Celery beat" docs, covering the strategy's purpose, an example `beat_schedule` config, and its requirements/limitations (warm-up user access, `DATA_CACHE_CONFIG`, per-user cache partition caveat, no cascading/search-term support).
### TESTING INSTRUCTIONS
Docs-only change. Rendered `docs/admin_docs/configuration/cache.mdx` locally to confirm formatting.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Follow-up docs for #41531.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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] docs(cache): document native filter option cache warm-up strategy [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42953:
URL: https://github.com/apache/superset/pull/42953#issuecomment-5237586162
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</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] docs(cache): document native filter option cache warm-up strategy [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #42953:
URL: https://github.com/apache/superset/pull/42953#discussion_r3746123417
##########
docs/admin_docs/configuration/cache.mdx:
##########
@@ -134,6 +134,43 @@ CELERY_CONFIG = CustomCeleryConfig
This will cache the top 5 most popular dashboards every hour. For other
strategies, check the `superset/tasks/cache.py` file.
+### Warming Up Native Filter Options
+
+Native filter Value-type dropdown option queries (e.g. `SELECT DISTINCT column FROM table`) are
+cached the same way as chart data, via `DATA_CACHE_CONFIG`. However, the strategies above only warm
+up chart render queries, so the first user to open a dashboard's filter dropdown after a cache entry
+expires still triggers a fresh database query.
+
+The `native_filter_options` strategy pre-populates the cache for these dropdown queries. It reads
+each dashboard's `native_filter_configuration`, builds the same `filter_select` chart-data query the
+frontend would send, and executes it as the configured `SUPERSET_CACHE_WARMUP_USER`:
+
+```python
+class CustomCeleryConfig(CeleryConfig):
+ beat_schedule = {
+ **CeleryConfig.beat_schedule,
+ 'cache-warmup-native-filters': {
+ 'task': 'cache-warmup',
+ 'schedule': crontab(minute=0, hour=3), # daily at 03:00
+ 'kwargs': {
+ 'strategy_name': 'native_filter_options',
+ 'dashboard_ids': [1, 2, 3],
+ },
+ },
+ }
+```
+
+Requirements and limitations:
+
+- `SUPERSET_CACHE_WARMUP_USER` must be set to a user with access to the dashboards and datasets
+ referenced by the native filters.
+- `DATA_CACHE_CONFIG` must be configured (Redis recommended).
Review Comment:
**Suggestion:** Requiring only that `DATA_CACHE_CONFIG` be configured is insufficient to make this strategy effective. A configured `NullCache`, an effective timeout of `-1`, or `NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT = -1` disables reusable cache writes, so the scheduled task still executes database queries without warming anything. Document that the effective cache backend must support storage and that the applicable timeout must be positive. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Default `NullCache` produces no warmed native-filter entries.
- ⚠️ Disabled timeouts still consume datasource query capacity.
- ⚠️ Users continue receiving cold dropdown queries.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=50e8d891440040a888990102367b8ee1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=50e8d891440040a888990102367b8ee1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/admin_docs/configuration/cache.mdx
**Line:** 167:167
**Comment:**
*Api Mismatch: Requiring only that `DATA_CACHE_CONFIG` be configured is insufficient to make this strategy effective. A configured `NullCache`, an effective timeout of `-1`, or `NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT = -1` disables reusable cache writes, so the scheduled task still executes database queries without warming anything. Document that the effective cache backend must support storage and that the applicable timeout must be positive.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42953&comment_hash=a163af9f909f447af3d3551d314d957f91c33649916eb7dd0f6c94398795421b&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42953&comment_hash=a163af9f909f447af3d3551d314d957f91c33649916eb7dd0f6c94398795421b&reaction=dislike'>👎</a>
##########
docs/admin_docs/configuration/cache.mdx:
##########
@@ -134,6 +134,43 @@ CELERY_CONFIG = CustomCeleryConfig
This will cache the top 5 most popular dashboards every hour. For other
strategies, check the `superset/tasks/cache.py` file.
+### Warming Up Native Filter Options
+
+Native filter Value-type dropdown option queries (e.g. `SELECT DISTINCT column FROM table`) are
+cached the same way as chart data, via `DATA_CACHE_CONFIG`. However, the strategies above only warm
+up chart render queries, so the first user to open a dashboard's filter dropdown after a cache entry
+expires still triggers a fresh database query.
+
+The `native_filter_options` strategy pre-populates the cache for these dropdown queries. It reads
+each dashboard's `native_filter_configuration`, builds the same `filter_select` chart-data query the
+frontend would send, and executes it as the configured `SUPERSET_CACHE_WARMUP_USER`:
+
+```python
+class CustomCeleryConfig(CeleryConfig):
+ beat_schedule = {
+ **CeleryConfig.beat_schedule,
+ 'cache-warmup-native-filters': {
+ 'task': 'cache-warmup',
+ 'schedule': crontab(minute=0, hour=3), # daily at 03:00
Review Comment:
**Suggestion:** The daily schedule does not guarantee that warmed entries remain valid until the next run. Chart, dataset, database, `DATA_CACHE_CONFIG`, and `NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT` settings can specify a shorter TTL, so operators following this example can still get cache misses for most of the day. Document that the schedule must be at least as frequent as the effective native-filter cache timeout, or use a suitably frequent schedule in the example. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Native filter dropdowns can miss cache most of each day.
- ⚠️ Expired entries trigger repeated datasource queries.
- ⚠️ Cache warm-up benefits depend on configured TTL values.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=be28bad34fc0491d98de113f8e6f8885&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=be28bad34fc0491d98de113f8e6f8885&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/admin_docs/configuration/cache.mdx
**Line:** 154:154
**Comment:**
*Logic Error: The daily schedule does not guarantee that warmed entries remain valid until the next run. Chart, dataset, database, `DATA_CACHE_CONFIG`, and `NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT` settings can specify a shorter TTL, so operators following this example can still get cache misses for most of the day. Document that the schedule must be at least as frequent as the effective native-filter cache timeout, or use a suitably frequent schedule in the example.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42953&comment_hash=cd6ed518ea7d846aee9dab97a10c95d9f86b5182f7b49c2baaeeadac88833475&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42953&comment_hash=cd6ed518ea7d846aee9dab97a10c95d9f86b5182f7b49c2baaeeadac88833475&reaction=dislike'>👎</a>
--
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] docs(cache): document native filter option cache warm-up strategy [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #42953:
URL: https://github.com/apache/superset/pull/42953#issuecomment-5235093375
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 4c227a0f3dff35c5ca077d5de14cb6964b2e59c9 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a79306a7f3841000897da90 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42953--superset-docs-preview.netlify.app](https://deploy-preview-42953--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#DYxBCsMgEAD_sucuXTFtYn_QZ2x1JUKiYkzbEPr37mUYGJgTaitr7fAAuMCrcfazekzfa9SAteFgbtZgFgkbhuI3jMIdPftZ8MNtxb1i5p7egjEteglSl3I8g37uPDpLyminwRDR5MbAjuD3Bw) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-42953--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] docs(cache): document native filter option cache warm-up strategy [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe merged PR #42953:
URL: https://github.com/apache/superset/pull/42953
--
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] docs(cache): document native filter option cache warm-up strategy [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42953:
URL: https://github.com/apache/superset/pull/42953#discussion_r3746773906
##########
docs/admin_docs/configuration/cache.mdx:
##########
@@ -134,6 +134,43 @@ CELERY_CONFIG = CustomCeleryConfig
This will cache the top 5 most popular dashboards every hour. For other
strategies, check the `superset/tasks/cache.py` file.
+### Warming Up Native Filter Options
+
+Native filter Value-type dropdown option queries (e.g. `SELECT DISTINCT column FROM table`) are
+cached the same way as chart data, via `DATA_CACHE_CONFIG`. However, the strategies above only warm
+up chart render queries, so the first user to open a dashboard's filter dropdown after a cache entry
+expires still triggers a fresh database query.
+
+The `native_filter_options` strategy pre-populates the cache for these dropdown queries. It reads
+each dashboard's `native_filter_configuration`, builds the same `filter_select` chart-data query the
+frontend would send, and executes it as the configured `SUPERSET_CACHE_WARMUP_USER`:
+
+```python
+class CustomCeleryConfig(CeleryConfig):
+ beat_schedule = {
+ **CeleryConfig.beat_schedule,
+ 'cache-warmup-native-filters': {
+ 'task': 'cache-warmup',
+ 'schedule': crontab(minute=0, hour=3), # daily at 03:00
Review Comment:
Good catch — added a note that the schedule needs to be at least as frequent as the effective native filter cache TTL, since the daily example only makes sense for TTLs of a day or more.
##########
docs/admin_docs/configuration/cache.mdx:
##########
@@ -134,6 +134,43 @@ CELERY_CONFIG = CustomCeleryConfig
This will cache the top 5 most popular dashboards every hour. For other
strategies, check the `superset/tasks/cache.py` file.
+### Warming Up Native Filter Options
+
+Native filter Value-type dropdown option queries (e.g. `SELECT DISTINCT column FROM table`) are
+cached the same way as chart data, via `DATA_CACHE_CONFIG`. However, the strategies above only warm
+up chart render queries, so the first user to open a dashboard's filter dropdown after a cache entry
+expires still triggers a fresh database query.
+
+The `native_filter_options` strategy pre-populates the cache for these dropdown queries. It reads
+each dashboard's `native_filter_configuration`, builds the same `filter_select` chart-data query the
+frontend would send, and executes it as the configured `SUPERSET_CACHE_WARMUP_USER`:
+
+```python
+class CustomCeleryConfig(CeleryConfig):
+ beat_schedule = {
+ **CeleryConfig.beat_schedule,
+ 'cache-warmup-native-filters': {
+ 'task': 'cache-warmup',
+ 'schedule': crontab(minute=0, hour=3), # daily at 03:00
+ 'kwargs': {
+ 'strategy_name': 'native_filter_options',
+ 'dashboard_ids': [1, 2, 3],
+ },
+ },
+ }
+```
+
+Requirements and limitations:
+
+- `SUPERSET_CACHE_WARMUP_USER` must be set to a user with access to the dashboards and datasets
+ referenced by the native filters.
+- `DATA_CACHE_CONFIG` must be configured (Redis recommended).
Review Comment:
Fair point — the default `NullCache` and `NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT = -1` both silently no-op the warm-up. Called both out explicitly.
--
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] docs(cache): document native filter option cache warm-up strategy [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42953:
URL: https://github.com/apache/superset/pull/42953#issuecomment-5235083050
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