Vitor-Avila commented on PR #32781:
URL: https://github.com/apache/superset/pull/32781#issuecomment-2749046272
> LGTM, although **please add docs**!
>
> Optional (crazy?) implementation idea - instead of making it a filter, we
could even introduce a new parameter `datetime: bool` which would automatically
spit out the endpoints as datetimes. Like so:
>
> ```python
> get_time_filter("dttm", datetime=True").from_expr # This would be a
datetime, not a string
> ```
>
> It's probably a bad idea, but saying it out loud, just in case..
@villebro Great catch on the docs! I totally forgot that 🤦 Will add them now
in a new commit.
I think that's actually a great idea, and would def make this: `{{
get_time_filter("dttm",
strftime="%Y-%m-%d").to_expr|to_datetime(format="%Y-%m-%d") }}` a lot smaller.
However, I think it's still valuable to have the filter in case someone is
passing a date as a URL parameter, or need to compare a "static date" manually
typed in a syntax against a dynamic filter? So I'd say having both would be
ideal.
I'll address feedback in a new commit here, would you like me to create a
follow up for `get_time_filter()`? Or would you prefer to do it?
--
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]