rscarborough1996 opened a new issue, #22893:
URL: https://github.com/apache/superset/issues/22893
When using from_dttm and to_dttm as parameters for a table-valued function,
other filters break
#### How to reproduce the bug
I am displaying a report via a table-valued function like so:
```
{% set operatorId = 'DEFAULT' %}
{% if filter_values('operatorId')|length == 1 %}
{% set operatorId = filter_values('operatorId')[0] %}
{% endif %}
{% set fromDttm = '1753-01-01 00:00:00' %}
{% set toDttm = '9999-12-31 23:59:59.997' %}
{% if from_dttm is not none %}
{% set fromDttm = from_dttm %}
{% endif %}
{% if to_dttm is not none %}
{% set toDttm = to_dttm %}
{% endif %}
SELECT * FROM [dbo].[myFunction]({{ operatorId }}, '{{ fromDttm }}', '{{
toDttm }}')
```
The bug involves a filter I made for the operatorId. Note, I had to set
default values for from_dttm and to_dttm, otherwise the filter would give a
"Bad request" error.
### Expected results
When the operatorId filter tries to get its values, and no time range is
given, the filter should return values that occur between '1753-01-01 00:00:00'
and '9999-12-31 23:59:59.997' (Basically, all of them).
### Actual results
Instead, to_dttm (ONLY in the context of the operatorId filter) seems to be
treated as the current datetime. Therefore, the filter only contains values
from '1753-01-01 00:00:00' to the current datetime.
#### Screenshots

The filter shows 2 options, but the table clearly shows 3 different options.
That is because some of the IDs occur after the current datetime.
### Environment
(please complete the following information):
- browser type and version: Chrome 109.0.5414.120 (Official Build) (64-bit)
- I am using the apache/superset:2.0.0 docker container
### Additional context
This is a continuation of a comment I left here: #16942
--
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]