Skip to content

Add validation for number of datetimes in Temporal.interval#22

Merged
lukas-phaf merged 7 commits intomainfrom
temporal-validation
Feb 21, 2025
Merged

Add validation for number of datetimes in Temporal.interval#22
lukas-phaf merged 7 commits intomainfrom
temporal-validation

Conversation

@lukas-phaf
Copy link
Collaborator

(Copy of PR #17)

Addresses and resolves the existing TODO comment for validating temporal list lengths.

Currently, the interval field of the Temporal data class doesn't validate the number of datetimes that are provided. Per the specification, each interval should consist of exactly two datetime strings, so we should change the interval from:

interval: List[List[AwareDatetime]]

to:

interval: List[Annotated[List[AwareDatetime], Len(min_length=2, max_length=2)]]

@lukas-phaf lukas-phaf changed the title Temporal validation Add validation for number of datetimes in Temporal.interval Feb 19, 2025
@codecov
Copy link

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.04%. Comparing base (84d6c16) to head (1df0127).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   98.02%   98.04%   +0.01%     
==========================================
  Files          10       10              
  Lines         203      205       +2     
==========================================
+ Hits          199      201       +2     
  Misses          4        4              
Flag Coverage Δ
unittests 98.04% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PaulVanSchayck PaulVanSchayck self-assigned this Feb 21, 2025
@lukas-phaf lukas-phaf merged commit faa9059 into main Feb 21, 2025
9 checks passed
@lukas-phaf lukas-phaf deleted the temporal-validation branch February 21, 2025 15:55
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.

3 participants