Repository navigation
MAINT: Type dataset cleanup and mutation results - #4837
Open
biefan (biefan) wants to merge 2 commits into
Open
biefan (biefan) wants to merge 2 commits into
biefan (biefan) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the typed dataset cleanup and mutation result changes.
No open issues 🎉
What changed in this PR
Adds explicit typed contracts for dataset cleanup and mutation results, addressing the dataset lifecycle portion of #4505.
Changes:
- Defines required result keys, including nullable version and error fields.
- Carries result types through memory APIs to the upload service.
- Extends SQLite tests to check result keys and cleanup outcomes.
| File | Description |
|---|---|
| tests/unit/memory/test_dataset_lifecycle.py | Checks typed keys, seed results, and cleanup outcomes. |
| tests/unit/backend/test_dataset_lifecycle.py | Types the mutation commit test wrapper. |
| pyrit/memory/memory_interface.py | Exposes typed cleanup and mutation returns. |
| pyrit/memory/dataset_mutation.py | Defines mutation result types and returns persisted seed IDs. |
| pyrit/memory/dataset_lifecycle.py | Defines and applies the cleanup result type. |
| pyrit/backend/services/dataset_upload_service.py | Uses the typed mutation result. |
Review effort: Balanced
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 #4505 (dataset lifecycle and mutation results).
The dataset upload service reads committed counts, seed IDs and cleanup status from the memory layer. This change gives those dictionaries explicit return types so a type checker can catch missing keys and callers that overlook a nullable field.
MemoryInterfaceto the upload service. A committed mutation always includesversion, which is null when the last seed is deleted. Cleanup always includeserror, which can also be null.