fix: Make DiscoveryMatch.label optional for non-sensitive/ignore matches#22
Open
jiatolentino wants to merge 2 commits into
Open
fix: Make DiscoveryMatch.label optional for non-sensitive/ignore matches#22jiatolentino wants to merge 2 commits into
jiatolentino wants to merge 2 commits into
Conversation
A non-sensitive or ignore discovery match carries no sensitivity label, but DiscoveryMatch required `label: str`, so parsing schema-discovery results that contained such a match (e.g. a scope.non_sensitive column, hit via the generate_ruleset path) raised a pydantic ValidationError. The schema_discovery CSV path never parsed the model, so this was latent until MongoDB document discovery exercised it.
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.
A non-sensitive or ignored discovery match carries no sensitivity label, but
DiscoveryMatchrequired
label: str. Parsing schema-discovery results that contained such a match (for example ascope.non_sensitivecolumn, reached via thegenerate_rulesetpath) raised a pydanticValidationError. Theschema_discoveryCSV path never deserialised the model, so this stayedlatent until MongoDB document discovery exercised it.
This applies the same treatment already given to
FileDiscoveryMatch.label, completing it forschema discovery.
DiscoveryMatch.labelis nowOptional[str] = None.Verified: ruff clean, and a
DiscoveryMatchconstructed without a label now parses (labelisNone).