-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
"Advanced" Date Time in Time Range Filter is Incorrect for "last", "this", "beginning", "start", "end" #30592
Comments
The issue you're experiencing with the "Last minutes" time range filter might be related to timezone handling. Superset uses the To address this, you might want to check if the timezone settings in your Superset configuration are correctly set to match your local timezone (EDT/EST). Additionally, ensure that both your database and Superset backend are configured to use UTC, as this can help avoid issues with temporal fields lacking explicit timezones [2]. If the problem persists, consider reviewing the logic in the |
@dosu Nope, changed both my database timezone and superset timezone ( |
Superset assumes timestamps are in UTC, and configuring the backend to a non-UTC timezone like EST/EDT can lead to issues. It's recommended to keep both the database and Superset backend in UTC to ensure consistency [1]. If you've already set both to UTC and the issue persists, it might be worth checking if there are any specific configurations or overrides in your setup that could affect timezone handling. Additionally, reviewing the logic in the |
I wonder if the underlying library (which I can't recall the name of) is interpreting "last two minutes" as the "last two minutes of the day" rather than the "last two minutes that occurred." In that case, it's right... and it's kind of a language/clarity failure. What happens if you say "prior two minutes" or "two minutes ago"? |
Hi @sam-hieken ! Thanks for filing this issue! I was about to report something very similar, hope you don't mind me making some edits/additions to your original issue to include some more details and other cases where the advanced filters aren't working. |
It seems to be using the last 2 minutes of yesterday though, which seems like a strange interpretation if that's what's happening. Plus the "last hour" uses the start of the hour before the current hour so that one isn't using yesterday. You're right that 2 minutes ago does work as expected though so that could be a workaround for the interim |
🎉 Preset Bounty Available: $150 USD 🎉To claim this bounty, please carefully follow the steps below. 📋 Steps to Participate
💡 Additional Notes
Good luck, and happy coding! 🎉 |
Hi @yousoph, no worries, please feel free! |
@rusackas So I've found that "2 minutes ago" works as desired like @yousoph said, but "Prior 2 minutes" will actually go 2 minutes into the future: I'm not familiar with Superset's codebase, but I've narrowed down the problem to the Endpoint:
|
Hey @geido can you assign this issue to me ? |
Hi @aybanda how is this going? |
Hey @geido I will be generating a PR very shortly. |
@geido is this still open I see a pr but it's closed can I work on this? |
I'm in line behind @Niharika0104. |
Hey @geido can I have a look at this issue? |
Bug description
Certain values in the Advanced Time Filters are not returning the correct values:
Repro steps:
In either a chart with a time filter or a dashboard with a time filter, select the "Advanced" option and try one of the above options.
Screenshots/recordings
For some clarity, the following test was performed on 2024-10-13T19:38:00-0400, give or take a few seconds. I'm in EDT/EST zone.
Last Hour:
Last 2 Minutes:
Obviously "Last 2 minutes" is way off - the timestamp is nowhere close, and the date shown is yesterday. Every dashboard with a time range filter I've tried this on has the same issue, and it happens in both the Start and End inputs.
Additional Screenshots
Start of this month:
(the "Today" is working correctly for reference of today's date)
End of next month:
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Firefox
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: