You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rscarborough1996 (via GitHub)" <gi...@apache.org> on 2023/01/27 21:36:22 UTC
[GitHub] [superset] rscarborough1996 opened a new issue, #22893: from_dttm and to_dttm behaving strangely with other filters
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
![image](https://user-images.githubusercontent.com/106171897/215204173-12758041-f474-46a5-a0df-0f494fb31034.png)
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: notifications-unsubscribe@superset.apache.org.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: [I] from_dttm and to_dttm behaving strangely with other filters [superset]
Posted by "rscarborough1996 (via GitHub)" <gi...@apache.org>.
rscarborough1996 closed issue #22893: from_dttm and to_dttm behaving strangely with other filters
URL: https://github.com/apache/superset/issues/22893
--
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: [I] from_dttm and to_dttm behaving strangely with other filters [superset]
Posted by "rscarborough1996 (via GitHub)" <gi...@apache.org>.
rscarborough1996 commented on issue #22893:
URL: https://github.com/apache/superset/issues/22893#issuecomment-1943744686
Testing in version 3.1.0 shows that to_dttm is now returning the correct value.
--
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