Time Detail Dimension View does not handle DST correctly
Describe the bug
There are issues with proper DST handling in the pivot table when opening the time detail dimension view and DST is included as part of the filtered time range. This issue will be further exacerbated if first_day_of_week is configured and set to a different value (e.g. Sunday), resulting in erroneous weekly columns on the wrong days to be displayed along with incorrect calculations. Originally reported by a customer here. We may want to extend the solution covered in #3494 (notion doc) to also apply to time detail dimension views as well.
To Reproduce Steps to reproduce the behavior:
- Clone the 311 Operational Metrics locally
- Apply the filter to include Nov 5 (daylight savings in the US)
- Drill into the time detail dimension view
- Check the weekly columns (around Nov 5) with a non-UTC timezone selected (e.g. CST or EST)
- Apply the
first_day_of_week: 7property to the dashboard YAML - Check the results and make sure the weekly columns (+ data) are correct
Expected behavior The pivot table should display the correct weekly columns, both data and the date / day shown in the column header, regardless if UTC or a different timezone with DST is being used.
Actual Behavior The pivot table displays incorrect weekly columns when a non-UTC timezone is being used where DST is a consideration.
Screenshots
DST issue with EST and no first_day_of_week set:
No DST issue when using UTC with no first_day_of_week set:
DST issue with CST and first_day_of_week: 7 set:
No DST issue with UTC and first_day_of_week: 7 set:
I checked main today, it works correctly.
First day - Monday
First day - Sunday
Timestamps are 7 days apart.
@egor-ryashin So I can confirm that the issue is still reproducible on main (it's likely a corner case). See screenshots - tested on both v0.38.2 and main.
Steps to reproduce:
- Use the
Rill-311-Opsexample project - Use the attached dashboard yaml to change the timezone to
America/Chicagoandfirst_day_of_weekto Sun - Drill into
Median Time to Resolve Ticket (Hours)from main dashboard view - Adjust date range to
Oct 29 - Nov 30and make sure that metric trends is set to week - Note that the column header in the TDD will still show Nov 4 (Sat) as first day of week instead of Nov 5 (Sun)