Skip to content

Fix empty timestamp handling in ISO deserialization#324

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
main-002d76e8b311cf46
Draft

Fix empty timestamp handling in ISO deserialization#324
github-actions[bot] wants to merge 1 commit intomainfrom
main-002d76e8b311cf46

Conversation

@github-actions
Copy link
Contributor

Summary

  • fix SerializationAdapter.load_dict() to treat created_at and expires_at as present when they are empty strings
  • parse any present ISO datetime string and raise DeserializationError on invalid values, including ""
  • add regression tests that verify empty created_at and expires_at are rejected

Changes

  • src/key_value/aio/_utils/serialization.py
    • changed truthiness checks to explicit is not None checks for created_at and expires_at
  • tests/utils/test_serialization.py
    • added test_rejects_empty_isoformat_datetime parameterized for both fields

Validation

AI generated by Issue Assistant

Treat empty strings for created_at/expires_at as provided values so isoformat parsing runs and raises DeserializationError for invalid timestamps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@macroscopeapp
Copy link
Contributor

macroscopeapp bot commented Feb 20, 2026

Raise deserialization errors for empty ISO created_at and expires_at in SerializationAdapter.load_dict in serialization.py

Change truthiness checks to explicit is not None so empty strings reach the datetime parser; add tests that assert DeserializationError for empty ISO timestamps.

📍Where to Start

Start with SerializationAdapter.load_dict in serialization.py.


Macroscope summarized 009164b.

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.

[bug-hunter] Serialization accepts empty created_at/expires_at instead of raising deserialization error

0 participants