Repository navigation
MAINT: Clear transparency_attack_converter from the keyword-only baseline - #4464
Open
SERAG AHMED (seragAhmed) wants to merge 2 commits into
Open
SERAG AHMED (seragAhmed) wants to merge 2 commits into
SERAG AHMED (seragAhmed) wants to merge 2 commits into
Conversation
…line Relates to microsoft#4216. Make the second array parameter of the three private TransparencyAttackConverter helpers keyword-only: - _compute_mse_loss(blended_image, *, target_tensor) - _create_blended_image(attack_image, *, alpha) - _save_blended_image_async(attack_image, *, alpha) Their only callers are in this module and in tests/unit/converter/test_transparency_attack_converter.py; nothing overrides them or passes them as callbacks. Update the callers and tests, add a test that positional calls are rejected, and remove the three baseline entries. No behaviour or public API changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new test needs the required _async name suffix, a str annotation for sample_benign_image, and a None return annotation.
1 open issue
What changed in this PR
This PR advances #4216 by migrating three private TransparencyAttackConverter helpers to keyword-only second arguments, without changing conversion behavior or the public API.
Changes:
- Update helper signatures and internal callers to use explicit keywords.
- Update unit tests and add coverage rejecting positional second arguments.
- Remove the three migrated helpers from the keyword-only baseline.
| File | Description |
|---|---|
tests/unit/converter/test_transparency_attack_converter.py |
Updates calls and tests positional-argument rejection. |
pyrit/converter/transparency_attack_converter.py |
Makes second helper arguments keyword-only and updates callers. |
build_scripts/keyword_only_baseline.txt |
Removes the three migrated helper entries. |
Review effort: Balanced
| mock_factory.assert_called_once_with(category="prompt-memory-entries", data_type="image_path") | ||
| mock_serializer.save_b64_image_async.assert_called_once() | ||
|
|
||
| async def test_blending_helpers_reject_positional_second_argument(self, sample_benign_image): |
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.

Description
Relates to #4216. Removes
pyrit.converter.transparency_attack_converterfrom the keyword-only baseline by making the second array parameter of its three private helpers keyword-only:_compute_mse_loss(blended_image, *, target_tensor)_create_blended_image(attack_image, *, alpha)_save_blended_image_async(attack_image, *, alpha)Their only callers are in this module and its unit tests; nothing overrides them or passes them as callbacks. The callers and tests are updated, a test checks that positional calls are rejected, and the three baseline entries are removed. No behaviour or public API change.
🤖 Generated with Claude Code