Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date time range parameter filter ignore end time #6327

Open
javierpelado opened this issue Jul 31, 2023 · 5 comments
Open

Date time range parameter filter ignore end time #6327

javierpelado opened this issue Jul 31, 2023 · 5 comments
Labels

Comments

@javierpelado
Copy link

Issue Summary

Trying to create a query that gets a date and time range filter as a parameter, I noticed that the counter was different than doing it directly within the DB.

The problem is that the filter doesn't use the time at the end threshold. It is filtering out all the records with date time which the date is later than the date end of the range.

It should include in the result the records with the same date and below the time at that threshold.

Example:

  • query using range date and time:
    image

    After changing the end threshold of the range one minute more what changes the day, all the records from the previous day appear
    image

Steps to Reproduce

  1. Use the Query results source which will give you sqlite env.
  2. Create a query that filters records using data and time range as a parameter in the form
          select
           createdAt
         from
           cached_query_3
         WHERE
            createdAt BETWEEN '{{ Range.start }}'
            and '{{ Range.end }}'
         order by
             createdAt
  3. Fix the end threshold of the range with a time that will include records from the day of it. EG: {day} 23:59
  4. See that in the results there are only records before {day}, none of the records during that day appear.

Technical details:

  • Redash Version: Version: 10.1.0 (2589bef)
  • Browser/OS: Chrome Version 114.0.5735.198 (Official Build) (arm64) / Macos Ventura 13.4.1 (22F82)
  • How did you install Redash: docker compose in and EC2 instance with external PostgreSQL at AWS Aurora
@justinclift
Copy link
Member

justinclift commented Jul 31, 2023

Oh, that's interesting.

It seems to be truncating the Range variable there to just the date component, ignoring any included time component. That does sound like a bug.

@gaecoli
Copy link
Member

gaecoli commented Aug 2, 2023

For date range (with seconds), we should add timezone to fix this bug.

@gaecoli
Copy link
Member

gaecoli commented Aug 2, 2023

For date range (with seconds), we should add timezone to fix this bug.

And it should add new date format, like hours 23, minutes 59, seconds 59 to format.

@justinclift
Copy link
Member

@gaecoli Want to try fixing it? 😄

@gaecoli
Copy link
Member

gaecoli commented Aug 2, 2023

@gaecoli Want to try fixing it? 😄

I will try to do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants