Repository navigation
MAINT: Make CLI source filtering data keyword-only - #4340
Merged
Roman Lutz (romanlutz) merged 4 commits intoNov 18, 2026
Merged
Roman Lutz (romanlutz) merged 4 commits into
Roman Lutz (romanlutz) merged 4 commits into
Conversation
Relates to microsoft#4216 Developed with assistance from OpenAI Codex.
Contributor
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change making _only_known’s data parameter keyword-only.
No open issues 🎉
What changed in this PR
This PR advances the keyword-only migration tracked in #4216 by making data keyword-only in the private CLI helper _only_known. The model_cls parameter remains positional-or-keyword, and filtering and hydration behavior remain unchanged.
Changes:
- Updates both hydration callers to pass
dataexplicitly. - Removes the helper’s keyword-only baseline entry.
- Adds tests for the signature, positional rejection, field filtering, value preservation, and input non-mutation.
| File | Description |
|---|---|
tests/unit/cli/test_sources.py |
Adds signature and filtering tests for both domain models. |
pyrit/cli/_sources.py |
Makes data keyword-only and updates both callers. |
build_scripts/keyword_only_baseline.txt |
Removes the migrated helper’s baseline entry. |
Review effort: Balanced
…s-keyword-only # Conflicts: # build_scripts/keyword_only_baseline.txt
The keyword-only convention is already enforced repo-wide by build_scripts/check_keyword_only_params.py in CI, so the inspect-based signature test and the positional-rejection test (which pins CPython's TypeError wording) add no coverage. Keep the behavior tests. Co-Authored-By: Claude Fable 5 <[email protected]>
Roman Lutz (romanlutz)
approved these changes
Nov 18, 2026
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.
Description
Make
datakeyword-only inpyrit.cli._sources._only_known, update both hydration callers, and remove its keyword-only baseline entry. The firstmodel_clsargument remains positional or keyword; field filtering and hydration behavior stay unchanged.Relates to #4216. Maintainer assignment.
Developed with assistance from OpenAI Codex; the patch and compatibility were reviewed locally and the focused and broader suites were run.