dosubot[bot] commented on issue #38219:
URL: https://github.com/apache/superset/issues/38219#issuecomment-3952798082

   <!-- Answer -->
   You're right! I stand corrected on my earlier response. Looking more closely 
at the code, the dynamic filter queries for SelectFilterPlugin go through a 
different path than I initially described.
   
   When "Load filter values dynamically" is enabled, the filter [builds its 
query via 
`buildQuery.ts`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/buildQuery.ts#L30-L74)
 and executes through the `/api/v1/chart/data` endpoint—the same endpoint used 
for regular chart queries. This means filter dropdown queries **do** go through 
[`QueryContextProcessor`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/query_context_processor.py#L130-L307)
 and 
[`QueryCacheManager`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/utils/query_cache_manager.py#L116-L124),
 which uses `DATA_CACHE_CONFIG`.
   
   So your observation is accurate: dynamic filter queries are being cached 
with `DATA_CACHE_CONFIG` timeout rather than `FILTER_STATE_CACHE_CONFIG` (which 
only stores user's filter *selections*, not the available options). This 
appears to be a legitimate bug/feature gap—there's no separate cache 
configuration for filter dropdown value queries.
   
   A workaround would be to lower your `DATA_CACHE_CONFIG` timeout, though that 
affects all chart queries. A proper fix would likely require either a separate 
cache config for filter queries or bypassing the cache entirely for filter 
value lookups.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/2a0ad91a-d98b-4902-b6fd-c0e834c04ac9?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/2a0ad91a-d98b-4902-b6fd-c0e834c04ac9?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/2a0ad91a-d98b-4902-b6fd-c0e834c04ac9?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/2a0ad91a-d98b-4902-b6fd-c0e834c04ac9?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/2a0ad91a-d98b-4902-b6fd-c0e834c04ac9?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/2a0ad91a-d98b-4902-b6fd-c0e834c04ac9?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/2a0ad91a-d98b-4902-b6fd-c0e834c04ac9?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%27re%20right%21%20I%20stand%20corrected%20on%20my%20earlier%20response.%20Looking%20more%20closely%20at%20the%20code%2C%20the%20dynamic%20filter%20queries%20for%20SelectFilterPlugin%20go%20through%20a%20different%20path%20than%20I%20initially%20described.%0A%0AWhen%20%22Load%20filter%20values%20dynamically%22%20is%20enabled%2C%20the%20filter%20%5Bbuilds%20its%20query%20via%20%60buildQuery.ts%60%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/filters/components/Select/buildQuery.ts%23L30-L74%29%20and%20executes%20through%20the%20%60/api/v1/chart/data%60%20endpoint%E2%80%94the%20same%20endpoint%20used%20for%20regular%20chart%20queries.%20This%20means%20filter%20dropdown%20queries%20%2A
 
%2Ado%2A%2A%20go%20through%20%5B%60QueryContextProcessor%60%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/query_context_processor.py%23L130-L307%29%20and%20%5B%60QueryCacheManager%60%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/utils/query_cache_manager.py%23L116-L124%29%2C%20which%20uses%20%60DATA_CACHE_CONFIG%60.%0A%0ASo%20your%20observation%20is%20accurate%3A%20dynamic%20filter%20queries%20are%20being%20cached%20with%20%60DATA_CACHE_CONFIG%60%20timeout%20rather%20than%20%60FILTER_STATE_CACHE_CONFIG%60%20%28which%20only%20stores%20user%27s%20filter%20%2Aselections%2A%2C%20not%20the%20available%20options%29.%20This%20appears%20to%20be%20a%20legitimate%20bug/feature%20gap%E2%80%94there%27s%20no%20separate%20cache%20configuration%20for%20filter%20dropdown%20value%20queries.%0A%0AA%20workaround%20would%20be%20to%20lower%20your%20%60DATA_CACHE_CONFIG%60%20timeout%2C%20th
 
ough%20that%20affects%20all%20chart%20queries.%20A%20proper%20fix%20would%20likely%20require%20either%20a%20separate%20cache%20config%20for%20filter%20queries%20or%20bypassing%20the%20cache%20entirely%20for%20filter%20value%20lookups.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38219)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to