Changes between Version 6 and Version 7 of Ticket #30575


Ignore:
Timestamp:
Jun 20, 2019, 7:26:25 AM (6 years ago)
Author:
Jurgis Pralgauskis
Comment:

Sorry, was a bug in my test, and failure didn't show up (probalby copied wrong revision here)..

The SQL is generated OK, but imo, the problem is that TruncBase#convert_value has the lines

                value = value.replace(tzinfo=None)   
                value = timezone.make_aware(value, self.tzinfo)  

they apply (replace) the same tzinfo to all (union'ed) rows (that come from different timezones)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30575

    • Property Resolution worksforme
    • Property Status closednew
  • Ticket #30575 – Description

    v6 v7  
    2727            for tzname in ['UTC', 'America/Los_Angeles']:
    2828                tz = pytz.timezone(tzname)
    29                 _qs = qs.filter(timezone=tzname)
     29                _qs = qs.filter(timezone=tzname)  # was but in test hardcoded "UTC" instead of `tzname`
    3030                _qs = _qs.annotate(trunc_local_time=TruncSecond('timestamp', tzinfo=tz)) # could be Trunc_anything_
    3131                partitions.append(_qs)
     
    4444}}}
    4545
     46Problem - different TZ offsets
    4647{{{
    4748Failure
    4849Traceback (most recent call last):
    49   File "/home/jurgis/dev/new/tableair/sync_tableair-cloud/ta/api/booking/tests/test_endpoints.py", line 1107, in test_demo_bug
     50  File "/home/jurgis/dev/new/tableair/sync_tableair-cloud/ta/api/bookables/tests/test_endpoints.py", line 689, in test_demo_bug
    5051    assert x.trunc_local_time == x.expected,  "Error (msg: '{x.msg}'): {x.trunc_local_time} != {x.expected}".format(x=x)
    51 AssertionError: Error (msg: 'bla'): 2016-12-31 16:00:00+00:00 != 2017-01-01 00:00:00+00:00}}}
     52AssertionError: Error (msg: 'foo'): 2016-12-31 16:00:00+00:00 != 2016-12-31 16:00:00-08:00
     53}}}
Back to Top