Skip to content

Fix unit test DataFunctionTest.test_tz_aware_datetime failure under random conditions #52

@bbassett-tibco

Description

@bbassett-tibco

It appears that during a recent workflow run, the DataFunctionTest.test_tz_aware_datetime unit test encountered a failure that appears to be the result of a rounding error during the truncation of microseconds to the SBDF format's millisecond resolution:

Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\spotfire\test\test_sbdf.py", line 436, in test_tz_aware_datetime
    self.assertEqual(val, now_roundtrip, f"df2[{col}] = {repr(val)}")
AssertionError: datetime.datetime(2023, 9, 8, 1, 51, 46, 382000) != datetime.datetime(2023, 9, 8, 1, 51, 46, 381000) : df2[naive] = datetime.datetime(2023, 9, 8, 1, 51, 46, 382000)

Note that the first value in the assertion (382000 us) is the value read back from the SBDF round trip, while the second value (381000 us) is the calculated value that is expected to be returned to Python from the SBDF file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions