Skip to content

Kanka: read a time with no offset as UTC - #35

Merged
tmoosting merged 2 commits into
mainfrom
kanka-naive-time
Nov 22, 2026
Merged

tmoosting merged 2 commits into
mainfrom
kanka-naive-time

Conversation

@tmoosting

Copy link
Copy Markdown
Member

A Kanka export whose campaign created_at has no time-zone offset while its entities' have one (or the other way round) stopped the door with TypeError: can't subtract offset-naive and offset-aware datetimes. A time with no offset is now read as UTC, the zone Kanka writes.

  • tests/test_kanka.py: a case for each direction (the campaign's time without an offset, then one entity's); watched failing with the fix taken out (the same TypeError).
  • The npm SDK's convertKanka gets the same change, so the two doors still write the same folder: on the three test exports and six variants with a time stripped of its offset, both doors' folders are byte for byte equal and their reports the same text.
  • Exports whose times all carry an offset, or all carry none, read as before.

🤖 Generated with Claude Code

tmoosting and others added 2 commits November 22, 2026 05:30
An export whose campaign created_at had no offset while its entities' had
one (or the other way round) stopped with a TypeError when the door
compared them to name possible starter entries. A time with no offset is
now read as UTC, the zone Kanka writes. Exports whose times all carry an
offset, or all carry none, read as before. A test holds both directions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ruff's UP017 and E501 on the previous commit; no behaviour moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmoosting
tmoosting merged commit 6c156a9 into main Nov 22, 2026
11 checks passed
@tmoosting
tmoosting deleted the kanka-naive-time branch November 22, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant