rumbin opened a new issue, #26195:
URL: https://github.com/apache/superset/issues/26195

   {{ from,_dttm }}`, `{{ to_dttm }}` or `{{ time_grain }} filters within a 
virtual dataset are not effective if this dataset is referenced (selected from) 
by another virtual dataset.
   
   #### How to reproduce the bug
   
   1. Create a virtual dataset which applies some push-down filtering by means 
of `{{ from,_dttm }}`, `{{ to_dttm }}` or `{{ time_grain }}`
   2. Create another virtual dataset which selects from the previously created 
dataset.
   3. Create a chart based on the second dataset and place it on a dashboard.
   4. Add a time range and/or a time grain filter to the dashboard and apply it.
   
   ### Expected results
   
   * The filter indicator reflects that the time range/grain filters are being 
applied to the chart on our dashboard.
   * The time filters are injected into the chart's query, deeply into the 
nested/referenced dataset.
   
   
   ### Actual results
   
   * Good: The filter indicator reflects that the time range/grain filters are 
being applied to the chart on our dashboard.
   * Bad: The time filters are _not_ injected into the nested/referenced 
dataset.
   
   #### Screenshots
   
   MWE:
   
   Dataset 1:
   ```sql
   SELECT
     '{{ from_dttm or "no_value_injected" }}' as from_dttm_of_nested_dataset
   ```
   
   Dataset 2:
   ```sql
   SELECT
     current_timestamp as main_dttm_column
     , '{{ from_dttm or "no_value_injected" }}' as from_dttm_of_main_dataset
     , from_dttm_of_nested_dataset
   from {{ dataset(590) }} -- adjust this ID to the one of Dataset 1 above
   ```
   
   Result:
   
![image](https://github.com/apache/superset/assets/1220356/53f025fa-2fcf-4762-8580-e2f4ae18babf)
   
   
![image](https://github.com/apache/superset/assets/1220356/4b5e8b61-7332-4936-ae3f-ad264d0532f7)
   
   The executed query shows that `{{ from_dttm }}` did not get injected into 
the nested dataset:
   
![image](https://github.com/apache/superset/assets/1220356/866b19c0-9e4e-4a26-8df6-f8c287f16d14)
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version:
   - superset version: 3.0.2
   - python version: `python --version`
   - node.js version: `node -v`
   - any feature flags active:
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   It should be noted that other `filter_values()` _do~ get injected into 
nested/referenced datasets correctly. For these we only have the issue that the 
filter indicator doesn't reflect it properly: #26194.
   


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