You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2024/09/03 23:32:51 UTC
[PR] Villebro/jinja temporal [superset]
villebro opened a new pull request, #30142:
URL: https://github.com/apache/superset/pull/30142
### SUMMARY
Currently the `from_dttm` and `to_dttm` Jinja variables make it possible to reference the time range endpoints from within the Jinja context. However, they have some shortcomings:
- `to_dttm` always points to the current day, even if there's no time range present in the query (this appears to be a quirk of how the `get_since_until` helper function works).
- They are always formatted using the `.isoformat()` method. This means that it's difficult to use them for database-specific formatting that's readily available in `BaseEngineSpec.convert_dttm`.
- It's impossible to access a specific time filter if there are multiple time filters present.
- Lastly, in the case of virtual datasets, it's not possible to remove the time filter from the outer query (this is possible for regular filter types using the `filter_value and `get_filters` macros).
This PR adds a new Jinja macro called `get_time_filter`, which returns a dataclass with the following properties:
- `since`: The start endpoint of the time range
- `until`: The end of the time range
- `time_range`: The (usually) human readable raw value of the time filter
TODO: more to come
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TODO: more to come
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2334261275
I added a self-assigned task for removing docs for `from_dttm` and `to_dttm` in favor of this macro in 5.0: https://github.com/orgs/apache/projects/345?pane=issue&itemId=78905534
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #30142:
URL: https://github.com/apache/superset/pull/30142
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal functionality [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2327636258
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/30142?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `39.47368%` with `23 lines` in your changes missing coverage. Please review.
> Project coverage is 77.09%. Comparing base [(`76d897e`)](https://app.codecov.io/gh/apache/superset/commit/76d897eaa2f9e137102bc194c2e3109c29d0348f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`1a8757b`)](https://app.codecov.io/gh/apache/superset/commit/1a8757bcb03a795dc732a03a6d08afc501235aef?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 660 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/30142?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [superset/jinja\_context.py](https://app.codecov.io/gh/apache/superset/pull/30142?src=pr&el=tree&filepath=superset%2Fjinja_context.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | 37.83% | [23 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/30142?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #30142 +/- ##
===========================================
+ Coverage 60.48% 77.09% +16.60%
===========================================
Files 1931 529 -1402
Lines 76236 38333 -37903
Branches 8568 0 -8568
===========================================
- Hits 46114 29552 -16562
+ Misses 28017 8781 -19236
+ Partials 2105 0 -2105
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `48.85% <39.47%> (-0.31%)` | :arrow_down: |
| [javascript](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.70% <39.47%> (?)` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.42% <39.47%> (-0.39%)` | :arrow_down: |
| [python](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.09% <39.47%> (+13.60%)` | :arrow_up: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.18% <39.47%> (?)` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/30142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/30142?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on code in PR #30142:
URL: https://github.com/apache/superset/pull/30142#discussion_r1745987115
##########
docs/docs/configuration/sql-templating.mdx:
##########
@@ -17,8 +17,8 @@ made available in the Jinja context:
- `columns`: columns which to group by in the query
- `filter`: filters applied in the query
-- `from_dttm`: start `datetime` value from the selected time range (`None` if undefined)
-- `to_dttm`: end `datetime` value from the selected time range (`None` if undefined)
+- `from_dttm`: start `datetime` value from the selected time range (`None` if undefined) (deprecated, use `get_time_filter` instead)
Review Comment:
Good call - I'll deprecate as of 5.0, as this will likely not be cherried into the 4.1 branch.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "Vitor-Avila (via GitHub)" <gi...@apache.org>.
Vitor-Avila commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2371139490
that totally makes sense! 🙏 I also believe this new macro would already allow you to pull distinct temporal filters from the chart context to apply to the inner query, which is super cool.
I 100% support and agree with those changes to the temporal filter - Ideally we should support selecting which temporal column is getting filtered, to allow multiple distinct filters in a dashboard (similar to the filter value). I think the only additional consideration is that right now when you create a chart, it automatically adds the dataset's main dttm column to the filter as a "placeholder", so that dashboard time range filters are applied to it. If it becomes possible to control/differentiate the column in the filter configuration, we would just need to make sure that this filter doesn't get applied to the "placeholder columns" too.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal functionality [superset]
Posted by "nytai (via GitHub)" <gi...@apache.org>.
nytai commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2330283031
So something that comes up often in the templateized datasets using these filter values is having defaults so that users can run the "sync columns from source" action and have their query execute. The dataset modal does have "Template parameters" setting but that actually ends up overriding anything set at the dashboard or chart level which is kind of unexpected.
I've been advising users to always use if/else to check if the filter values are defined otherwise fallback to a reasonable default (eg last week or day), so that their query is valid even if not run in a dashboard or chart context. It would be good to bake this default behavior into the jinja expression so that expressing this is a little less verbose. Something like:
`get_time_filter(..., default_time_range="Last Week")` and maybe even `get_time_filter(..., default_ from_expr ="2024-09-04", default_to_expr="2024-09-05")`
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "jkryanchou (via GitHub)" <gi...@apache.org>.
jkryanchou commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2525276169
I wish this feature should be released as soon as it possible.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal functionality [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2332207193
@nytai I've added the default option in the latest commit: https://github.com/apache/superset/pull/30142/commits/288e6af1b08bd25be6d72ebf6d27e69c3aa3a7ba
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on code in PR #30142:
URL: https://github.com/apache/superset/pull/30142#discussion_r1745971217
##########
docs/docs/configuration/sql-templating.mdx:
##########
@@ -346,6 +346,75 @@ Here's a concrete example:
order by lineage, level
```
+**Time Filter**
+
+The `{{ get_time_filter() }}` macro returns the time filter applied to a specific column. This is useful if you want
+to handle time filters inside the virtual dataset, as by default the time filter is placed on the outer query. This can
+have considerable performance implications, as many databases and query engines are able to optimize the query better
+if the temporal filter is placed on the inner query, as opposed to the outer query.
+
+The macro takes the following parameters:
+- `column`: Name of the temporal column. Leave undefined to reference the time range from a Dashboard Native Time Range
+ filter (when present).
+- `default`: The default value to fall back to if the time filter is not present, or has the value `No filter`
+- `target_type`: The target temporal type as recognized by the target database (e.g. `TIMESTAMP`, `DATE` or
+ `DATETIME`). If `column` is defined, the format will default to the type of the column. This is used to produce
+ the format of the `from_expr` and `to_expr` properties of the returned `TimeFilter` object.
+- `remove_filter`: When set to true, mark the filter as processed, removing it from the outer query. Useful when a
+ filter should only apply to the inner query.
+
+The return type has the following properties:
+- `from_expr`: the start of the time filter (if any)
+- `to_expr`: the end of the time filter (if any)
+- `time_range`: The time range as defined on the
Review Comment:
This line is incomplete -- defined on the what?
##########
docs/docs/configuration/sql-templating.mdx:
##########
@@ -346,6 +346,75 @@ Here's a concrete example:
order by lineage, level
```
+**Time Filter**
+
+The `{{ get_time_filter() }}` macro returns the time filter applied to a specific column. This is useful if you want
+to handle time filters inside the virtual dataset, as by default the time filter is placed on the outer query. This can
+have considerable performance implications, as many databases and query engines are able to optimize the query better
Review Comment:
clarifying that the performance implications are positive
##########
superset/jinja_context.py:
##########
@@ -354,6 +375,78 @@ def get_filters(self, column: str, remove_filter: bool = False) -> list[Filter]:
return filters
+ def get_time_filter(
+ self,
+ column: str | None = None,
+ default: str | None = None,
+ target_type: str | None = None,
+ remove_filter: bool = False,
+ ) -> TimeFilter:
+ """Get the time filter with appropriate formatting,
+ either for a specific column, or whichever time range is being emitted
+ from a dashboard.
+
+ :param column: Name of the temporal column. Leave undefined to reference the
+ time range from a Dashboard Native Time Range filter (when present).
+ :param default: The default value to fall back to if the time filter is
+ not present, or has the value `No filter`
+ :param target_type: The target temporal type as recognized by the target
+ database (e.g. `TIMESTAMP`, `DATE` or `DATETIME`). If `column` is defined,
+ the format will default to the type of the column. This is used to produce
+ the format of the `from_expr` and `to_expr` properties of the returned
+ `TimeFilter` object. Note, that omitting `column` and `target_type` will
+ render format the temporal values as ISO format.
Review Comment:
```suggestion
render the temporal values as ISO format.
```
##########
docs/docs/configuration/sql-templating.mdx:
##########
@@ -346,6 +346,75 @@ Here's a concrete example:
order by lineage, level
```
+**Time Filter**
+
+The `{{ get_time_filter() }}` macro returns the time filter applied to a specific column. This is useful if you want
+to handle time filters inside the virtual dataset, as by default the time filter is placed on the outer query. This can
+have considerable performance implications, as many databases and query engines are able to optimize the query better
Review Comment:
```suggestion
considerably improve performance, as many databases and query engines are able to optimize the query better
```
##########
docs/docs/configuration/sql-templating.mdx:
##########
@@ -17,8 +17,8 @@ made available in the Jinja context:
- `columns`: columns which to group by in the query
- `filter`: filters applied in the query
-- `from_dttm`: start `datetime` value from the selected time range (`None` if undefined)
-- `to_dttm`: end `datetime` value from the selected time range (`None` if undefined)
+- `from_dttm`: start `datetime` value from the selected time range (`None` if undefined) (deprecated, use `get_time_filter` instead)
Review Comment:
Maybe say "deprecated beginning in version 4.1.0" since we don't have versioned docs?
##########
docs/docs/configuration/sql-templating.mdx:
##########
@@ -346,6 +346,75 @@ Here's a concrete example:
order by lineage, level
```
+**Time Filter**
+
+The `{{ get_time_filter() }}` macro returns the time filter applied to a specific column. This is useful if you want
+to handle time filters inside the virtual dataset, as by default the time filter is placed on the outer query. This can
+have considerable performance implications, as many databases and query engines are able to optimize the query better
+if the temporal filter is placed on the inner query, as opposed to the outer query.
+
+The macro takes the following parameters:
+- `column`: Name of the temporal column. Leave undefined to reference the time range from a Dashboard Native Time Range
+ filter (when present).
+- `default`: The default value to fall back to if the time filter is not present, or has the value `No filter`
+- `target_type`: The target temporal type as recognized by the target database (e.g. `TIMESTAMP`, `DATE` or
+ `DATETIME`). If `column` is defined, the format will default to the type of the column. This is used to produce
+ the format of the `from_expr` and `to_expr` properties of the returned `TimeFilter` object.
+- `remove_filter`: When set to true, mark the filter as processed, removing it from the outer query. Useful when a
+ filter should only apply to the inner query.
+
+The return type has the following properties:
+- `from_expr`: the start of the time filter (if any)
+- `to_expr`: the end of the time filter (if any)
+- `time_range`: The time range as defined on the
+
+Here's a concrete example using the `logs` table from the Superset metastore:
+
+```
+{% set time_filter = get_time_filter("dttm", remove_filter=True) %}
+{% set from_expr = time_filter.from_expr %}
+{% set to_expr = time_filter.to_expr %}
+{% set time_range = time_filter.time_range %}
+SELECT
+ *,
+ '{{ time_range }}' as time_range
+FROM logs
+{% if from_expr or to_expr %}WHERE 1 = 1
+{% if from_expr %}AND dttm >= {{ from_expr }}{% endif %}
+{% if to_expr %}AND dttm < {{ to_expr }}{% endif %}
+{% endif %}
+```
+
+Assuming we are creating a table chart with a simple `COUNT(*)` as the metric with a time filter `Last week` on the
+`dttm` column, this would render the following query on Postgres (note the formatting of the temporal filters, and
+the missing filters on the outer query):
Review Comment:
```suggestion
the absence of time filters on the outer query):
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal functionality [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2330295162
> So something that comes up often in the templateized datasets using these filter values is having defaults so that users can run the "sync columns from source" action and have their query execute. The dataset modal does have "Template parameters" setting but that actually ends up overriding anything set at the dashboard or chart level which is kind of unexpected.
>
> I've been advising users to always use if/else to check if the filter values are defined otherwise fallback to a reasonable default (eg last week or day), so that their query is valid even if not run in a dashboard or chart context. It would be good to bake this default behavior into the jinja expression so that expressing this is a little less verbose. Something like:
>
> `get_time_filter(..., default_time_range="Last Week")` and maybe even `get_time_filter(..., default_from_expr ="2024-09-04", default_to_expr="2024-09-05")`
That's a really good idea 👍 To keep things simple, I would prefer only having `default_time_range`, as it would be possible to express the explicit dates in the latter example with the time range syntax as follows: `"2024-09-04 : 2024-09-05"`. And maybe even simplifying the naming further to keep it in line with the existing `filter_values`, and just calling it `default`:
```python
def get_time_filter(
self,
column: str | None = None,
default: str | None = None,
target_type: str | None = None,
remove_filter: bool = False,
) -> TimeFilter:
...
# logic to populate time_range from filter value
...
if time_range == NO_TIME_RANGE and default:
time_range = default
...
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "Vitor-Avila (via GitHub)" <gi...@apache.org>.
Vitor-Avila commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2370044506
hey @villebro,
This is amazing! Thank you so much for working on this new macro. 🙏 It's super powerful -- can't wait to test it. 🙌
One question: you mentioned that one of the limitations with the `from_dttm` and `to_dttm` macros is the inability to apply multiple temporal filters. Could you confirm if this is now possible with this macro? I could see it happening since it supports specifying a `column`, however in the dashboard temporal filter a column is not specified, so I assume it's still impossible to add two distinct/indepentent temporal filters at the dashboard level -- is that correct?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2370068792
> hey @villebro,
>
> This is amazing! Thank you so much for working on this new macro. 🙏 It's super powerful -- can't wait to test it. 🙌
Thanks for the feedback, super happy if this is useful to someone else, too ❤️
> One question: you mentioned that one of the limitations with the `from_dttm` and `to_dttm` macros is the inability to apply multiple temporal filters. Could you confirm if this is now possible with this macro? I could see it happening since it supports specifying a `column`, however in the dashboard temporal filter a column is not specified, so I assume it's still impossible to add two distinct/indepentent temporal filters at the dashboard level -- is that correct?
With this it's indeed possible to extract the temporal value for multiple different columns. However, in the context of dashboard filtering, unfortunately the dashboard time range filter doesn't yet support applying to a specific temporal column (when the time range filter applies a value, I believe it attaches to all temporal filters currently 🙁). What I'd like to see is adding an optional dataset and column dropdown in the time range filter, and if that's selected, then it will apply a temporal filter only to that column. I've heard lots of people ask for that, and it shouldn't be that difficult to implement IMO.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(jinja): add advanced temporal filter functionality [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30142:
URL: https://github.com/apache/superset/pull/30142#issuecomment-2332397382
Thanks for the review @sfirke ! All very good callouts, I've addressed the comments in https://github.com/apache/superset/pull/30142/commits/0212fa9192848d634f77f2ca139436eda5f9bd81
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org