Skip to content

Improve validation#217

Open
llucax wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
llucax:validation
Open

Improve validation#217
llucax wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
llucax:validation

Conversation

@llucax

@llucax llucax commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
  • Validate Location coordinates in __post_init__
  • Validate PaginationInfo.total_items is non-negative
  • Fix rated_fuse_current validation error message

Part of #203.

llucax added 3 commits June 16, 2026 13:00
Reject out-of-range and NaN latitude or longitude values on direct
construction using the same inclusive bounds as the proto converter,
while keeping converter sanitization unchanged.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Reject negative `total_items` values with the exact value in the error
message while keeping zero and positive values valid.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Keep accepting zero by preserving the `< 0` guard and correct the
message to say non-negative instead of positive.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax requested a review from a team as a code owner June 16, 2026 11:01
@llucax llucax requested review from shsms and removed request for a team June 16, 2026 11:01
@llucax llucax self-assigned this Jun 16, 2026
@llucax llucax added this to the v0.4.1 milestone Jun 16, 2026
@github-actions github-actions Bot added part:tests Affects the unit, integration and performance (benchmarks) tests part:microgrid Affects the microgrid protobuf definitions part:pagination Affects the pagination protobuf definitions labels Jun 16, 2026
@llucax llucax added cmd:skip-release-notes It is not necessary to update release notes for this PR and removed part:tests Affects the unit, integration and performance (benchmarks) tests part:microgrid Affects the microgrid protobuf definitions part:pagination Affects the pagination protobuf definitions labels Jun 16, 2026
@llucax llucax enabled auto-merge June 16, 2026 11:02
@llucax llucax added part:tests Affects the unit, integration and performance (benchmarks) tests part:microgrid Affects the microgrid protobuf definitions part:pagination Affects the pagination protobuf definitions labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd:skip-release-notes It is not necessary to update release notes for this PR part:microgrid Affects the microgrid protobuf definitions part:pagination Affects the pagination protobuf definitions part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant