Skip to content

fix(native-filters): use FILTER_STATE_CACHE_CONFIG timeout for dynamic filter option queries - #38910

Merged
rusackas merged 15 commits into
apache:masterfrom
Ujjwaljain16:fix/native-filter-cache-timeout
Jul 24, 2026
Merged

fix(native-filters): use FILTER_STATE_CACHE_CONFIG timeout for dynamic filter option queries#38910
rusackas merged 15 commits into
apache:masterfrom
Ujjwaljain16:fix/native-filter-cache-timeout

Conversation

@Ujjwaljain16

@Ujjwaljain16 Ujjwaljain16 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

User description

SUMMARY

Dynamic native filter option queries currently go through /api/v1/chart/data, which causes them to use DATA_CACHE_CONFIG. This leads to stale dropdown values, especially in cases involving frequently changing data or RLS.

This change introduces a minimal fix in QueryContextProcessor.get_cache_timeout():

  • Detect native filter option queries via:

    • native_filter_id
    • viz_type starting with filter_
    • absence of metrics
  • Use FILTER_STATE_CACHE_CONFIG["CACHE_DEFAULT_TIMEOUT"] when available

  • Fallback to existing DATA_CACHE_CONFIG behavior otherwise

This keeps the existing query and caching pipeline intact while aligning cache TTL with filter semantics (high volatility, user-sensitive).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A (behavioral/backend fix)

TESTING INSTRUCTIONS

  1. Configure different cache timeouts:

    • DATA_CACHE_CONFIG["CACHE_DEFAULT_TIMEOUT"] = X
    • FILTER_STATE_CACHE_CONFIG["CACHE_DEFAULT_TIMEOUT"] = Y
  2. Create a dashboard with a native filter using dynamic filter values

  3. Trigger filter value loading:

    • Verify that response cache_timeout equals Y
  4. Verify non-filter queries:

    • Use a regular chart request
    • Confirm cache_timeout equals X
  5. Remove FILTER_STATE_CACHE_CONFIG["CACHE_DEFAULT_TIMEOUT"]:

    • Confirm filter queries fall back to DATA_CACHE_CONFIG

ADDITIONAL INFORMATION


CodeAnt-AI Description

Use the filter-state cache timeout for native filter option loading

What Changed

  • Native filter dropdown requests can now use the filter-state cache timeout instead of the regular chart data timeout when the new setting is enabled.
  • If the filter-state timeout is not set, these requests fall back to the usual chart data cache timeout.
  • A zero cache timeout is now respected instead of being ignored and replaced by a default value.

Impact

✅ Fewer stale filter dropdown values
✅ Clearer cache control for native filters
✅ Reliable no-cache behavior when timeout is set to 0

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@bito-code-review

bito-code-review Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3d241a

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 7a31764..b457d02
    • superset/common/query_context_processor.py
    • tests/integration_tests/charts/data/api_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

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 documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added api Related to the REST API change:backend Requires changing the backend dashboard:native-filters Related to the native filters of the Dashboard infra:caching Infra setup and configuration related to caching labels Mar 27, 2026
@github-actions github-actions Bot removed the api Related to the REST API label Mar 27, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Mar 27, 2026
@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.28%. Comparing base (67924ad) to head (191a06d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #38910   +/-   ##
=======================================
  Coverage   65.28%   65.28%           
=======================================
  Files        2793     2793           
  Lines      157260   157269    +9     
  Branches    35955    35957    +2     
=======================================
+ Hits       102660   102666    +6     
- Misses      52623    52625    +2     
- Partials     1977     1978    +1     
Flag Coverage Δ
hive 38.48% <27.27%> (-0.01%) ⬇️
mysql 57.71% <100.00%> (+<0.01%) ⬆️
postgres 57.75% <100.00%> (+<0.01%) ⬆️
presto 40.41% <36.36%> (+<0.01%) ⬆️
python 59.16% <100.00%> (+<0.01%) ⬆️
sqlite 57.38% <100.00%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread superset/common/query_context_processor.py Outdated
@Ujjwaljain16

Copy link
Copy Markdown
Contributor Author

agreed that 0 should be treated as a valid explicit timeout (disable cache) rather than falling through

Updating to check against None instead of using a truthiness check

@bito-code-review

bito-code-review Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #abc847

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 7a31764..836d22a
    • superset/common/query_context_processor.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

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 documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@sadpandajoe
sadpandajoe requested a review from Copilot March 31, 2026 17:26
@sadpandajoe

Copy link
Copy Markdown
Member

@Ujjwaljain16 can we make the current behavior the default and then have a new config flag to change the order of operations. Concerned that this could break for other people and what other places that may be overriding this.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts cache timeout selection for native filter dynamic option queries so dropdown values use the filter-state cache TTL (reducing staleness vs chart-data caching).

Changes:

  • Update QueryContextProcessor.get_cache_timeout() to detect native filter option queries and prefer FILTER_STATE_CACHE_CONFIG["CACHE_DEFAULT_TIMEOUT"].
  • Add integration tests validating filter vs non-filter timeout behavior and fallback to DATA_CACHE_CONFIG.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
tests/integration_tests/charts/data/api_tests.py Adds integration tests covering new cache-timeout selection logic for native filter option queries.
superset/common/query_context_processor.py Implements native filter query detection and uses filter-state cache timeout when configured.

Comment thread tests/integration_tests/charts/data/api_tests.py Outdated
Comment thread tests/integration_tests/charts/data/api_tests.py Outdated
Comment thread tests/integration_tests/charts/data/api_tests.py
Comment thread tests/integration_tests/charts/data/api_tests.py
Comment thread superset/common/query_context_processor.py Outdated
@Ujjwaljain16

Ujjwaljain16 commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

@sadpandajoe

That makes sense we shouldn’t change default behavior here.

I’ll gate this behind a config flag ( NATIVE_FILTER_USE_FILTER_STATE_CACHE_TIMEOUT, default False) so existing setups continue to use DATA_CACHE_CONFIG and users can opt in to the new behavior.

Will update the PR accordingly....

…ption queries

Dynamic filter dropdown queries routed through /api/v1/chart/data were
incorrectly cached using DATA_CACHE_CONFIG, causing stale dropdown values
for users with RLS or frequently-changing filter options.

Changes:
- Add opt-in flag NATIVE_FILTER_QUERIES_USE_FILTER_STATE_TIMEOUT (default
  False) so existing deployments are unaffected
- Gate new logic in QueryContextProcessor.get_cache_timeout() behind the
  flag; detection uses native_filter_id + filter_* viz_type + no metrics
- Fix integration tests: use superset.common.query_context_processor
  .current_app.config as mock patch target (more stable than LocalProxy)
- Extract _native_filter_cache_config() helper to eliminate duplicated
  config dicts across three tests
- Add test asserting explicit cache_timeout=0 is honored (not treated as
  falsy and bypassed by is not None guard)

Fixes apache#38219
@codeant-ai-for-open-source codeant-ai-for-open-source Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Mar 31, 2026
@Ujjwaljain16

Copy link
Copy Markdown
Contributor Author

Addressed the feedbacks

@netlify

netlify Bot commented Mar 31, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 56dfd2b
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69cc4a08d7578f000823fac5
😎 Deploy Preview https://deploy-preview-38910--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Mar 31, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a251cb7
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a61f396852b2100074df17f
😎 Deploy Preview https://deploy-preview-38910--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #722ae9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 836d22a..461e786
    • superset/common/query_context_processor.py
    • superset/config.py
    • tests/integration_tests/charts/data/api_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

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 documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

Copy link
Copy Markdown
Member

Thanks for digging in on this one. Two things I want to understand before merging... the detection requires not form_data.get("metrics"), but the native filter form_data in nativeFilters/utils.ts sets metrics: ['count'], so wouldn't that branch never fire for a real Select filter? And since it's gated behind a new flag that's off by default, the stale-dropdown the issue describes isn't fixed out of the box, operators have to flip NATIVE_FILTER_QUERIES_USE_FILTER_STATE_TIMEOUT and set the timeout. Is that the intended UX, or should this just be the default behavior? Curious if you tested against an actual dynamic filter rather than the synthetic form_data in the tests.

@Ujjwaljain16
Ujjwaljain16 force-pushed the fix/native-filter-cache-timeout branch from 0bd20c3 to c48643e Compare June 14, 2026 00:09
@Ujjwaljain16

Copy link
Copy Markdown
Contributor Author

@rusackas
Thanks for the detailed feedback i spent some time tracing the full native filter request flow again and revisited the previous assumptions
you were right about the metrics check the earlier detection logic was incorrect because nativeFilters/utils.ts::getFormData() always populates form_data with metrics: ["count"] for native filter requests the tests in the previous iteration were using a synthetic payload that did not accurately represent the real frontend contract which meant the new path would never have been exercised in production i updated the detection logic to rely on the stable fields that identify native filter requests: native_filter_id together with the filter_* viz type prefix and added tests using realistic native filter payloads to prevent this from regressing

also while revisiting the implementation i realized that using FILTER_STATE_CACHE_CONFIG was the wrong abstraction
native filter option loading is still a chart-data query that goes through /api/v1/chart/data, so it should continue using the existing data cache infrastructure the actual requirement is not a separate cache backend but an independent freshness policy for these dataset-derived filter values

the new approach introduces NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT (default None) which preserves the existing behavior unless operators explicitly configure a separate TTL when configured it is evaluated before the dataset/database timeout resolution so cases where datasets have a long cache timeout (for example 24 hours) can still configure more frequently refreshed native filter values

i also verified the timeout precedence chain to make sure explicit request-level overrides still win the final order is:

custom_cache_timeoutNATIVE_FILTER_OPTIONS_CACHE_TIMEOUT → slice/dataset/database timeout → DATA_CACHE_CONFIG → global default.

test coverage has been updated to cover:

  • realistic native filter requests (metrics: ["count"])
  • native filter timeout override
  • dataset timeout override (ensuring dataset-level TTLs do not mask the native filter TTL)
  • standard chart behavior remaining unchanged
  • cache disabled semantics using CACHE_DISABLED_TIMEOUT
  • false positive protection for non-filter visualizations
  • request-level custom_cache_timeout precedence

i also expanded the detection comment with the frontend contract details explaining why metrics should not be used as a signal.

thanks again for pushing back on the initial approach the review comment helped uncover a few incorrect assumptions in the original implementation and i think the final design aligns much better with the existing cache ownership and timeout hierarchy
please take another look whenever you get a chance happy to make any additional adjustments....

@bito-code-review

bito-code-review Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #fd48ca

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 461e786..d743079
    • superset/common/query_context_processor.py
    • superset/config.py
    • tests/integration_tests/charts/data/api_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

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 documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

Copy link
Copy Markdown
Member

@Ujjwaljain16 this is much better, thanks!

The native_filter_id + filter_ detection lines up with nativeFilters/utils.ts and the precedence chain reads right, so I think we're close here...

Since NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT defaults to None, #38219's stale dropdown still isn't fixed until an operator sets it. Did you confirm the override actually refreshes the values against a real dynamic filter (not just the synthetic payloads in the tests)?

Stoked to see CI is green!

@Ujjwaljain16

Ujjwaljain16 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@rusackas

i verified this end-to-end using a real dashboard native filter with "dynamically search all filter values" enabled

with NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT = 180, i observed:

  • first search: cache miss (is_cached: null), value returned from the database.
  • immediate repeat: cache hit (is_cached: true).
  • after deleting the row and waiting for the 180-sec TTL to expire: cache miss (is_cached: null) and the deleted value no longer appeared (rowcount: 0).

this confirms that dynamic native filter option queries honor NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT and refresh correctly after the configured TTL instead of relying on the general data cache timeout

u are right that with the current default of None, existing installations will retain the previous behavior until an operator configures the new setting
i kept the default as None to preserve backward compatibility and avoid changing cache behavior for existing deployments
happy to adjust further as needed

Comment on lines +1717 to +1720
def test_native_filter_default_uses_data_cache_timeout(
test_client,
login_as_admin,
physical_query_context,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Add type annotations for each fixture parameter and include an explicit -> None return annotation on this new test function. [custom_rule]

Severity Level: Minor 🧹

Why it matters? ⭐

This is newly added Python test code and the function parameters are unannotated, with no explicit return type. That violates the Python type-hint requirement for modified/new code.

Rule source 📖

.cursor/rules/dev-standard.mdc (line 28)

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** tests/integration_tests/charts/data/api_tests.py
**Line:** 1717:1720
**Comment:**
	*Custom Rule: Add type annotations for each fixture parameter and include an explicit <code>-> None</code> return annotation on this new test function.

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
👍 | 👎

Comment on lines +1731 to +1734
def test_native_filter_uses_native_filter_options_cache_timeout(
test_client,
login_as_admin,
physical_query_context,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Add explicit parameter type hints and a -> None return type to this newly introduced test function. [custom_rule]

Severity Level: Minor 🧹

Why it matters? ⭐

This added test function omits parameter type hints and a return annotation, which is exactly the kind of new Python code the rule flags.

Rule source 📖

.cursor/rules/dev-standard.mdc (line 28)

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** tests/integration_tests/charts/data/api_tests.py
**Line:** 1731:1734
**Comment:**
	*Custom Rule: Add explicit parameter type hints and a <code>-> None</code> return type to this newly introduced test function.

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
👍 | 👎

Comment on lines +1745 to +1748
def test_native_filter_overrides_dataset_timeout(
test_client,
login_as_admin,
physical_query_context,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Annotate all function parameters with concrete types and add a -> None return annotation for this test. [custom_rule]

Severity Level: Minor 🧹

Why it matters? ⭐

This is a newly introduced Python function with untyped parameters and no explicit return type, so it violates the type-hint rule.

Rule source 📖

.cursor/rules/dev-standard.mdc (line 28)

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** tests/integration_tests/charts/data/api_tests.py
**Line:** 1745:1748
**Comment:**
	*Custom Rule: Annotate all function parameters with concrete types and add a <code>-> None</code> return annotation for this test.

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
👍 | 👎

Comment on lines +1767 to +1770
def test_standard_chart_uses_dataset_timeout(
test_client,
login_as_admin,
physical_query_context,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Add type hints for all fixture arguments and specify an explicit -> None return type on this added function. [custom_rule]

Severity Level: Minor 🧹

Why it matters? ⭐

This added test function has unannotated parameters and lacks a return annotation, which is a real violation of the Python type-hint rule.

Rule source 📖

.cursor/rules/dev-standard.mdc (line 28)

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** tests/integration_tests/charts/data/api_tests.py
**Line:** 1767:1770
**Comment:**
	*Custom Rule: Add type hints for all fixture arguments and specify an explicit <code>-> None</code> return type on this added function.

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
👍 | 👎

Comment on lines +1795 to +1798
def test_native_filter_cache_disabled_semantics(
test_client,
login_as_admin,
physical_query_context,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Provide explicit type hints for the parameters and add a -> None return annotation for this new test function. [custom_rule]

Severity Level: Minor 🧹

Why it matters? ⭐

This newly added function omits type hints for its parameters and return type, so it matches the custom rule violation.

Rule source 📖

.cursor/rules/dev-standard.mdc (line 28)

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** tests/integration_tests/charts/data/api_tests.py
**Line:** 1795:1798
**Comment:**
	*Custom Rule: Provide explicit type hints for the parameters and add a <code>-> None</code> return annotation for this new test function.

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
👍 | 👎

@apache apache deleted a comment from codeant-ai-for-open-source Bot Jul 21, 2026

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but if you want to assess the latest bot comments, that'd make me feel better before merging :D

Comment thread superset/common/query_context_processor.py
Comment thread tests/integration_tests/charts/data/api_tests.py Outdated
@bito-code-review

bito-code-review Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #ceb7e9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: d743079..191a06d
    • tests/integration_tests/charts/data/api_tests.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

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 documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas
rusackas merged commit 3ff5dbf into apache:master Jul 24, 2026
59 checks passed
niteshpurohit added a commit to HiMamaInc/superset that referenced this pull request Jul 24, 2026
* refactor(mcp): dedupe list-tool schemas and delete dead middleware (apache#41923)

* fix(ag-grid-table): respect row limit with server pagination (apache#41346)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* feat(table/pivot-table): correct non-additive totals/subtotals via DB rollup [SIP-216] (apache#41184)

Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>

* feat(datasets): add RLS filter indicator badge to dataset list and explore view (apache#38807)

Co-authored-by: Evan <evan@preset.io>

* fix(chart): updates counties of kenya map (apache#38019)

Co-authored-by: Zack Adams <zack@Zacks-Laptop.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Evan <evan@preset.io>
Co-authored-by: Evan Rusackas <evan@rusackas.com>

* chore(deps): bump actions/setup-go from 6.5.0 to 7.0.0 (apache#42303)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump nanoid from 5.0.9 to 6.0.0 in /superset-frontend (apache#42230)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: Joe Li <joe@preset.io>
Co-authored-by: Evan <evan@preset.io>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* test(dashboard): migrate dashboard load smoke test to Playwright (apache#41432)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(superset_app_root): when used with oauth (apache#38033)

Signed-off-by: Grégoire Bellon-Gervais <gregoire.bellon-gervais@docaposte.fr>
Co-authored-by: Evan Rusackas <evan@preset.io>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* refactor: engine enforce SQLAlchemy 2.0 (apache#42277)

* fix(ag-grid-table): avoid ambiguous build query import (apache#42313)

* fix: Revert "chore(deps): bump echarts from 5.6.0 to 6.1.0 in /superset-frontend" (apache#42314)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* adding circleci config

* fix(plugin-chart-echarts): import the -obj locale build so time axes render (apache#42317)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* fix(pandas_postprocessing): avoid FutureWarning for max/min in boxplot MINMAX (apache#42272)

* fix(heatmap): correct tooltip axis value lookup and percentage calculations and add tests (apache#41864)

Signed-off-by: yousoph <sophieyou12@gmail.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(forecast): resolve time grain robustly for Prophet forecasting (apache#42145)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* fix: Added PostgreSQL 17.X to the supported database versions table in (apache#42280)

* fix(helm): add MCP HTTPRoute configuration (apache#42219)

* fix(dashboard): offer Exit edit mode when there is nothing to discard (apache#42208)

Co-authored-by: Claude Code <noreply@anthropic.com>

* chore(deps): bump actions/labeler from 6.2.0 to 7.0.0 (apache#42332)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github/codeql-action/analyze from 4.37.0 to 4.37.1 (apache#42331)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github/codeql-action/init from 4.37.0 to 4.37.1 (apache#42334)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @formatjs/intl-durationformat from 0.10.17 to 0.10.18 in /superset-frontend (apache#42337)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump caniuse-lite from 1.0.30001805 to 1.0.30001806 in /docs (apache#42333)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump echarts to 6.1.0 with locale and containLabel guards (apache#42315) (apache#42321)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>

* docs: add pattern to the list of organisations using superset (apache#42341)

* chore(deps): bump ag-grid from 36.0.0 to 36.0.1 in /superset-frontend (apache#42338)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>

* fix(mcp): trust dataset is_dttm flag when applying time_grain to VARCHAR temporal columns (apache#42288)

* chore(deps-dev): update taos-ws-py requirement from >=0.6.9 to >=0.7.0 (apache#42344)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump the storybook group in /superset-frontend with 5 updates (apache#42355)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(native-filters): keep filter value input caret at inline start (apache#42323)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* fix(mcp): truncate query-tool responses instead of hard-failing (apache#42244)

* chore(deps): bump nh3 from 0.3.5 to 0.3.6 (apache#42349)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump pydantic from 2.11.7 to 2.13.4 (apache#42350)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump sqlalchemy-continuum from 1.6.0 to 1.7.0 (apache#42351)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* fix(embedded): stop rejecting guest chart data built from control-specific params keys (apache#42295)

Co-authored-by: Claude Code <noreply@anthropic.com>

* fix(explore): show the beginning date on time-series x-axis line charts (apache#42046)

* fix(api): add example to get_export_ids_schema so Swagger "Try it out" pre-fills a valid array (apache#42265)

* chore: SQLAlchemy User cascade backref warnings are irrelevant (apache#42360)

* fix(charts): handle async (202) chart-data responses in StatefulChart (apache#42157)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Evan Rusackas <evan@preset.io>

* feat(KustoKQL): Add support for NULL / IS NOT NULL operator (apache#37890)

Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump pillow from 12.2.0 to 12.3.0 (apache#42348)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump flask-compress from 1.17 to 1.24 (apache#42346)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps-dev): bump databricks-sql-connector from 4.2.6 to 4.3.0 (apache#42347)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>
Co-authored-by: Evan Rusackas <evan@preset.io>

* fix(native-filters): use FILTER_STATE_CACHE_CONFIG timeout for dynamic filter option queries (apache#38910)

* fix(explore): render Jinja before validating legacy chart filters (apache#41996)

* fix(dataset): disable duplicate button when name is empty (apache#42217)

Co-authored-by: AS-MAC-1123 <as-mac-1123@AS-MAC-1123.local>
Co-authored-by: Evan Rusackas <evan@rusackas.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* docs(gunicorn): correct dead links in values.yaml (apache#42385)

* chore(deps): bump @deck.gl/mapbox from 9.3.6 to 9.3.7 in /superset-frontend in the deckgl group (apache#42377)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/checkout from 7.0.0 to 7.0.1 (apache#42376)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump immer from 11.1.11 to 11.1.15 in /superset-frontend (apache#42378)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump body-parser from 1.20.5 to 1.20.6 in /docs (apache#42370)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump brace-expansion from 1.1.15 to 1.1.16 in /superset-embedded-sdk (apache#42369)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(security): bump pyasn1 from 0.6.3 to 0.6.4 (apache#42363)

* fix(security): bump pillow from 12.2.0 to 12.3.0 (apache#42362)

* docs(map-tiles): add Yandex Maps Tiles API configuration (apache#42375)

* ci: improve conditional checks for lillio tests and build

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: Grégoire Bellon-Gervais <gregoire.bellon-gervais@docaposte.fr>
Signed-off-by: yousoph <sophieyou12@gmail.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: SkinnyPigeon <e.blackledge@stuart.com>
Co-authored-by: Zack <adams.z.d@gmail.com>
Co-authored-by: Zack Adams <zack@Zacks-Laptop.local>
Co-authored-by: Evan Rusackas <evan@rusackas.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: Joe Li <joe@preset.io>
Co-authored-by: Grégoire <greggbg@gmail.com>
Co-authored-by: Hans Yu <hans.yu@outlook.de>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Co-authored-by: yousoph <sophieyou12@gmail.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
Co-authored-by: Amitesh Gupta <143833521+singlaamitesh@users.noreply.github.com>
Co-authored-by: David <39565245+dmunozv04@users.noreply.github.com>
Co-authored-by: Yash Shrivastava <119301033+alephys26@users.noreply.github.com>
Co-authored-by: JUST.in DO IT <justin.park@airbnb.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jesperct <jmilecelento@gmail.com>
Co-authored-by: Abdul Rehman <76230556+Abdulrehman-PIAIC80387@users.noreply.github.com>
Co-authored-by: jenwitteng <jenwit.amonpongitsara@agoda.com>
Co-authored-by: Ramachandran A G <106139410+ag-ramachandran@users.noreply.github.com>
Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
Co-authored-by: Ujjwal Jain <jainujjwal1609@gmail.com>
Co-authored-by: Jean Massucatto <massucattoj@gmail.com>
Co-authored-by: suvankardas216 <rohanrohan510@gmail.com>
Co-authored-by: AS-MAC-1123 <as-mac-1123@AS-MAC-1123.local>
Co-authored-by: Alejandro Solares <219859296+ASolarers-Rodriguez@users.noreply.github.com>
Co-authored-by: ViktorGo86 <114023094+ViktorGo86@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:backend Requires changing the backend dashboard:native-filters Related to the native filters of the Dashboard infra:caching Infra setup and configuration related to caching size/L size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic query filters use data cache instead of filter state cache

4 participants