-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: human time must not hard set the timezone #350
Conversation
Hello @lvaylet, I don't understand why some checks failed as it works well and I'm pretty sure the method signature is correct. Regards, |
Hello @sdenef-adeo, I will take a look later today. |
@sdenef-adeo The dt_tz = datetime.fromtimestamp(timestamp, tz=to_zone) But then the |
Hello @lvaylet, 👌 |
I quickly checked yesterday but was unable to spot the exact source(s). These CVEs were probably reported recently. I wil work on a separate PR tomorrow and let you know when you can merge. |
@sdenef-adeo I just created #352 and will start investigate soon. |
@sdenef-adeo Done. Can you merge fb35d87 into your PR? |
merged |
Then I guess you also have to remove |
Thanks @sdenef-adeo. Now that all checks complete successfully, let me reproduce the (bad) behavior and check this PR fixes it. |
I just confirmed that the current code does not return the expected values. For example: $ python
Python 3.9.15 (main, Nov 5 2022, 10:20:53)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from slo_generator.utils import get_human_time
>>> get_human_time(1702660513.987654, timezone='Europe/Paris')
'2023-12-15T17:15:13.987654+01:00'
>>> get_human_time(1565092435, timezone='Europe/Paris')
'2019-08-06T11:53:55.000000+02:00' According to Epoch & Unix Timestamp Conversion Tools, the first call should return '2023-12-15T18:15:13.987654+01:00'. The second call should return '2019-08-06T13:53:55.000000+02:00'. Your version returns the right values. Can you rebase your branch as it is now out-of-date? Then I will merge this PR. |
963029e
to
d2ed268
Compare
for sure @lvaylet It should be OK now. |
Not quite. GitHub still reports 'This branch is out-of-date with the base branch'. I will move forward anyway, as these changes do not overlap with anything in recent PRs. |
I understand. It should be due to my "master branch" on the fork repo is out-of-date. I will do. |
Head branch was pushed to by a user without write access
184a28c
to
42dea17
Compare
All good. Thanks for your patience @sdenef-adeo! |
Hello,
utils.get_human_time() function format a UNIX timestamp as string to be stored into BigQuery.
But it replaces the timezone without dealing with the UTC time.
Using datetime.fromtimestamp() do the job well.
Tests have been updated accordingly.
Regards,
Sébastien