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

   <!-- Answer -->
   This looks like a regression introduced by **PR #36012** 
[[1]](https://github.com/apache/superset/pull/36012).
   
   The issue stems from a validation conflict:
   
   1. When you check "filter has default value" for a time range filter, the 
code initializes the default value as `[null, null]` 
[[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L1342-L1376)
   2. However, the `isValidFilterValue` function requires at least one non-null 
value: `Array.isArray(value) &amp;&amp; (value[0] !== null || value[1] !== 
null)` 
[[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L740-L745)
   3. This causes immediate validation failure, which shows an error instead of 
the time picker
   
   Additionally, PR #36012 changed the `shouldShowTimeRangePicker` behavior to 
hide the time range picker when no dataset is loaded (previously it defaulted 
to showing it), which may compound the issue by preventing you from setting a 
valid time value.
   
   The "metric count" error message appears to be a misleading validation error 
from this conflict rather than an actual metric-related issue.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention 
[@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/001326e8-1798-4085-9e0b-9443fdfbffe7?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/001326e8-1798-4085-9e0b-9443fdfbffe7?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/001326e8-1798-4085-9e0b-9443fdfbffe7?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/001326e8-1798-4085-9e0b-9443fdfbffe7?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose)
 | [Hallucination](https://app.dosu.dev/response-feedback/001326e8-1798
 
-4085-9e0b-9443fdfbffe7?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/001326e8-1798-4085-9e0b-9443fdfbffe7?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/001326e8-1798-4085-9e0b-9443fdfbffe7?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-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&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20looks%20like%20a%20regression%20introduced%20by%20%2A%2APR%20%2336012%2A%2A%20%5B%5B1%5D%5D%28https%3A//github.com/apache/superset/pull/36012%29.%0A%0AThe%20issue%20stems%20from%20a%20validation%20conflict%3A%0A%0A1.%20When%20you%20check%20%22filter%20has%20default%20value%22%20for%20a%20time%20range%20filter%2C%20the%20code%20initializes%20the%20default%20value%20as%20%60%5Bnull%2C%20null%5D%60%20%5B%5B2%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L1342-L1376%29%0A2.%20However%2C%20the%20%60isValidFilter
 
Value%60%20function%20requires%20at%20least%20one%20non-null%20value%3A%20%60Array.isArray%28value%29%20%26amp%3B%26amp%3B%20%28value%5B0%5D%20%21%3D%3D%20null%20%7C%7C%20value%5B1%5D%20%21%3D%3D%20null%29%60%20%5B%5B3%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx%23L740-L745%29%0A3.%20This%20causes%20immediate%20validation%20failure%2C%20which%20shows%20an%20error%20instead%20of%20the%20time%20picker%0A%0AAdditionally%2C%20PR%20%2336012%20changed%20the%20%60shouldShowTimeRangePicker%60%20behavior%20to%20hide%20the%20time%20range%20picker%20when%20no%20dataset%20is%20loaded%20%28previously%20it%20defaulted%20to%20showing%20it%29%2C%20which%20may%20compound%20the%20issue%20by%20preventing%20you%20from%20setting%20a%20valid%20time%20value.%0A%0AThe%20%22metric%20count%22%20error%20message%20appears%20to%20be%20a%20misleading%2
 
0validation%20error%20from%20this%20conflict%20rather%20than%20an%20actual%20metric-related%20issue.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord)&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/38936)


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