Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/corva/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def wrapper(
return

app_event = event.metadata.log_type.event.model_validate(
event.model_copy(update={"records": records}, deep=True).model_dump()
event.copy(update={"records": records}, deep=True).model_dump()
)
with LoggingContext(
aws_request_id=aws_request_id,
Expand Down
6 changes: 3 additions & 3 deletions src/corva/models/stream/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class RawMetadata(CorvaBaseEvent):
RecordsTime = Sequence[RawTimeRecord]
RecordsDepth = Sequence[RawDepthRecord]
else:
RecordsBase = Annotated[List[RawBaseRecord], Field(min_length=1)]
RecordsTime = Annotated[List[RawTimeRecord], Field(min_length=0)]
RecordsDepth = Annotated[List[RawDepthRecord], Field(min_length=1)]
RecordsBase = Annotated[List[RawBaseRecord], Field(min_items=1)]
RecordsTime = Annotated[List[RawTimeRecord], Field(min_items=0)]
RecordsDepth = Annotated[List[RawDepthRecord], Field(min_items=1)]


class RawStreamEvent(CorvaBaseEvent, RawBaseEvent):
Expand Down
4 changes: 2 additions & 2 deletions src/corva/models/stream/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class StreamDepthRecord(CorvaBaseEvent):
RecordsTime = Sequence[StreamTimeRecord]
RecordsDepth = Sequence[StreamDepthRecord]
else:
RecordsTime = Annotated[List[StreamTimeRecord], Field(min_length=1)]
RecordsDepth = Annotated[List[StreamDepthRecord], Field(min_length=1)]
RecordsTime = Annotated[List[StreamTimeRecord], Field(min_items=1)]
RecordsDepth = Annotated[List[StreamDepthRecord], Field(min_items=1)]


class StreamEvent(CorvaBaseEvent):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_scheduled_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def test_set_schedule_start(
def app(e, api, state):
return e

event = event.model_copy(update={'schedule_start': value})
event = event.copy(update={'schedule_start': value})
app_event = (
type(event)
.model_validate(
Expand Down