Project

General

Profile

Actions

Bug #7617

closed

Timeline bucket snapping/rounding does not respect the user-defined timezone

Added by Jakub Maloštik over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Low
Category:
Development - Core
Target version:
Start date:
11/25/2022
Due date:
% Done:

0%

Estimated time:
To be discussed:

Description

The timestamps are stripped of their timezone data prior to calculating timeline steps and boundaries causing multiple-day-sized buckets to be split at 00:00 UTC instead of 00:00 of the selected timezone.

Actions #1

Updated by Jakub Maloštik over 1 year ago

  • Assignee set to Jakub Maloštik
Actions #2

Updated by Jakub Maloštik over 1 year ago

  • Status changed from New to In Progress
Actions #3

Updated by Jakub Maloštik over 1 year ago

  • Status changed from In Progress to Resolved
Actions #4

Updated by Rajmund Hruška over 1 year ago

  • Status changed from Resolved to In Progress

Merged into devel, but the build failed.

Two tests failed:

======================================================================
FAIL: test_03_datetime_rounding (mentat.stats.test_idea.TestMentatStatsIdea)
Test datetime rounding
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/workers/worker-mentat-py3/mentat-check/build/lib/mentat/stats/test_idea.py", line 387, in test_03_datetime_rounding
    datetime.datetime(2022, 10, 11, 23, 0, 0)
AssertionError: datetime.datetime(2022, 10, 12, 1, 0) != datetime.datetime(2022, 10, 11, 23, 0)
======================================================================
FAIL: test_05_timeline_steps (mentat.stats.test_idea.TestMentatStatsIdea)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/workers/worker-mentat-py3/mentat-check/build/lib/mentat/stats/test_idea.py", line 505, in test_05_timeline_steps
    88
AssertionError: Tuples differ: (datetime.datetime(2018, 1, 1, 4, 0), datetime.timedelta(seconds=10800), 88) != (datetime.datetime(2018, 1, 1, 3, 0), datetime.timedelta(seconds=10800), 88)
First differing element 0:
datetime.datetime(2018, 1, 1, 4, 0)
datetime.datetime(2018, 1, 1, 3, 0)
- (datetime.datetime(2018, 1, 1, 4, 0), datetime.timedelta(seconds=10800), 88)
?                                ^
+ (datetime.datetime(2018, 1, 1, 3, 0), datetime.timedelta(seconds=10800), 88)
?                                ^

Actions #5

Updated by Jakub Maloštik over 1 year ago

  • Status changed from In Progress to Resolved

Rajmund Hruška wrote in #note-4:

Merged into devel, but the build failed.

Two tests failed:
[...]

The problem was Pythons datetimes implicit timezone insertion based on the machines timezone when using .astimezone().

Actions #6

Updated by Rajmund Hruška over 1 year ago

  • Status changed from Resolved to In Review

Deployed on mentat-alt.

Actions #7

Updated by Rajmund Hruška over 1 year ago

  • Target version set to 2.11
Actions #8

Updated by Rajmund Hruška about 1 year ago

  • Status changed from In Review to Closed
  • To be discussed deleted (Yes)
Actions

Also available in: Atom PDF