kevinjqliu opened a new pull request, #8131: URL: https://github.com/apache/iceberg/pull/8131
Running `test_datetime_to_millis` datetime test locally errors when system timezone is not UTC. This is because [`datetime.timestamp()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp) returns the POSIX timestamp using the system local timezone. My currently timezone Pacific time (PT) is 7 hours behind UTC. Run command: ``` make install make test ``` Error message: ``` =================================================================================== FAILURES ==================================================================================== ____________________________________________________________________________ test_datetime_to_millis ____________________________________________________________________________ def test_datetime_to_millis() -> None: dt = datetime(2023, 7, 10, 10, 10, 10, 123456) expected = int(dt.timestamp() * 1_000) datetime_millis = datetime_to_millis(dt) > assert datetime_millis == expected E assert 1688983810123 == 1689009010123 tests/utils/test_datetime.py:61: AssertionError ``` The difference between the 2 timestamp (`1688983810123` & `1689009010123`) is `-25200000`, which is 7 hours in milliseconds. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
