CodeWithPravinMaske commented on PR #44527:
URL: https://github.com/apache/superset/pull/44527#issuecomment-5788048636

   Screenshots as requested:
   
   **Adding the new filter type** — "Date range filter" shows up in the Filter 
Type dropdown alongside the existing filter types (Value, Time range, Time 
column, Time grain, Numerical range):
   
   ![filter type 
dropdown](https://github.com/user-attachments/assets/placeholder-1)
   
   **The rendered filter bar control** — a plain calendar date-range picker, no 
time-of-day fields, no No filter/Advanced/Relative/Previous options — filtering 
a real dashboard (note the dependent chart's data has changed to the selected 
range):
   
   ![filter bar](https://github.com/user-attachments/assets/placeholder-2)
   
   @sfirke re: Jinja templating — it works exactly like the Time Range filter, 
no special-casing needed. The filter emits `extraFormData.time_range` as a 
`"YYYY-MM-DD : YYYY-MM-DD"` string, the same shape the Time Range filter 
produces. Superset's `get_time_filter()` Jinja macro 
(`superset/jinja_context.py`) reads directly off `form_data.get("time_range")` 
regardless of which filter type produced it, so `{{ 
get_time_filter(column).from_expr }}` / `.to_expr` and any dataset-level Jinja 
using `time_range` work identically whether the value came from Time Range or 
this new Date range filter.
   
   Thanks for flagging the discussion thread (#19798) — this PR takes the 
"additive new filter type" path discussed there rather than modifying the 
existing Time Range filter, specifically so it doesn't change behavior for 
anyone already using Time Range.
   


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