Skip to content

fix: Make DiscoveryMatch.label optional for non-sensitive/ignore matches#22

Open
jiatolentino wants to merge 2 commits into
datamasque:mainfrom
jiatolentino:DM-2712-mongodb-discovery-support
Open

fix: Make DiscoveryMatch.label optional for non-sensitive/ignore matches#22
jiatolentino wants to merge 2 commits into
datamasque:mainfrom
jiatolentino:DM-2712-mongodb-discovery-support

Conversation

@jiatolentino

Copy link
Copy Markdown
Contributor

A non-sensitive or ignored discovery match carries no sensitivity label, but DiscoveryMatch
required label: str. Parsing schema-discovery results that contained such a match (for example a
scope.non_sensitive column, reached via the generate_ruleset path) raised a pydantic
ValidationError. The schema_discovery CSV path never deserialised the model, so this stayed
latent until MongoDB document discovery exercised it.

This applies the same treatment already given to FileDiscoveryMatch.label, completing it for
schema discovery.

  • DiscoveryMatch.label is now Optional[str] = None.
  • Release 1.1.1 (HISTORY.rst, pyproject.toml, setup.cfg, and the uv.lock self-version).

Verified: ruff clean, and a DiscoveryMatch constructed without a label now parses (label is
None).

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.
@jiatolentino jiatolentino self-assigned this Jun 24, 2026
@jiatolentino jiatolentino marked this pull request as ready for review June 24, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant