Page MenuHomeSoftware Heritage

Fix TimestampWithTimezone.from_dict() on datetimes before 1970 with non-integer seconds
ClosedPublic

Authored by vlorentz on Jan 12 2022, 2:27 PM.

Diff Detail

Repository
rDMOD Data model
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25967
Build 40584: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 40583: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D6924 (id=25090)

Rebasing onto 94b00d6877...

Current branch diff-target is up to date.
Changes applied before test
commit ff6594b59db208b5112e8a5de8fd62433466f16c
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Jan 12 14:27:15 2022 +0100

    Fix TimestampWithTimezone.from_dict() on datetimes before 1970 with non-integer seconds in TZ offsets
    
    `int()` rounds negative numbers up.

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/442/ for more details.

vlorentz retitled this revision from Fix TimestampWithTimezone.from_dict() on datetimes before 1970 with non-integer seconds in TZ offsets to Fix TimestampWithTimezone.from_dict() on datetimes before 1970 with non-integer seconds.Jan 12 2022, 2:39 PM
vlorentz edited the summary of this revision. (Show Details)

Build is green

Patch application report for D6924 (id=25093)

Rebasing onto 94b00d6877...

Current branch diff-target is up to date.
Changes applied before test
commit ccf2c5dfcbc9a1444e144d60601c4d384080e8aa
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Jan 12 14:27:15 2022 +0100

    Fix TimestampWithTimezone.from_dict() on datetimes before 1970 with non-integer seconds

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/443/ for more details.

minimize the diff by restoring the algo based on .replace()

Build is green

Patch application report for D6924 (id=25094)

Rebasing onto 94b00d6877...

Current branch diff-target is up to date.
Changes applied before test
commit dbf185c3b36c4d79d4214bbf29425c58ba4aa6ba
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Jan 12 14:27:15 2022 +0100

    Fix TimestampWithTimezone.from_dict() on datetimes before 1970 with non-integer seconds

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/444/ for more details.

olasd added a subscriber: olasd.

Thanks!

swh/model/model.py
488–490

Maybe that'd be worth a (separate) warning if the remainder is non-zero...

This revision is now accepted and ready to land.Jan 12 2022, 2:47 PM
swh/model/model.py
488–490

indeed, I'll add it later