Implement min/max list length validation - #3722
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends netlab’s attribute validation for list-typed attributes by adding support for minimum and maximum list length constraints, along with updated coverage tests and developer documentation describing the new validation options.
Changes:
- Add
min_length/max_lengthsupport to the list type validator (must_be_list). - Replace the previous empty-list error coverage with a more comprehensive list validation error fixture (
attr-list.yml/.log). - Document the new list validation options in the developer validation types reference.
Reviewed changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/coverage/errors/attr-list.yml | New coverage error topology exercising empty/non-empty, nested-list, and min/max list length behaviors. |
| tests/coverage/errors/attr-list.log | Expected error output for the new list validation coverage scenario. |
| tests/coverage/errors/attr-empty-list.yml | Removed older, narrower empty-list coverage fixture (superseded by attr-list). |
| tests/coverage/errors/attr-empty-list.log | Removed expected log for the superseded empty-list fixture. |
| netsim/data/types.py | Implements min_length / max_length checks in must_be_list. |
| docs/dev/validation-types.txt | Documents min_length / max_length list validation options and adds a footnote clarifying scalar-to-list conversion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.