Repository navigation
FIX: Return no message pieces for empty value filters in get_message_pieces - #4787
Open
simple-minded (hakarrr) wants to merge 3 commits into
Open
simple-minded (hakarrr) wants to merge 3 commits into
simple-minded (hakarrr) wants to merge 3 commits into
Conversation
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change making empty list filters return no message pieces.
No open issues 🎉
What changed in this PR
Fixes #4773 by making empty list filters consistently return no message pieces, preventing dynamically built empty filters from retrieving all stored pieces.
Changes:
- Extend the existing
prompt_ids=[]early return to all three value filters. - Add parametrized tests confirming that empty lists match nothing while
Noneleaves results unfiltered.
| File | Description |
|---|---|
tests/unit/memory/memory_interface/test_interface_prompts.py |
Test empty-list and None behavior for each value filter. |
pyrit/memory/memory_interface.py |
Return an empty result when any of the four list filters is empty. |
Review effort: Balanced
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
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.
Fixes #4773
get_message_piecesreturned every piece whenoriginal_values,converted_valuesorconverted_value_sha256was an empty list, whileprompt_ids=[]already returned[]. An empty list now matches nothing for all four list filters.Nonestill means no filter._execute_get_message_piecesto cover the three value filters.prompt_ids=[]test, covering[]andNonefor each filter.