Generated PII tags can attribute evidence to the wrong recognizer
Affected module
Ingestion Framework
Describe the bug
Auto-classification can attach recognizer metadata that disagrees with the evidence used to score a tag. For multiple results under one tag, the tag score is the maximum result score, but metadata takes the first result's recognizer name and ID and pairs them with that maximum score. A runtime wrapper whose name differs from its configured recognizer can also leave the recognizer metadata absent.
To Reproduce
Using the shipped PII recognizers at ba688d6058:
- Score the
PII.NonSensitivecandidate for columnphonewith synthetic sample valuesJune 2024and+1 202-555-0146. The surviving spaCy date result scores 0.85; the later phone result scores 1.0. The candidate correctly scores 1.0, but its metadata namesSpacyRecognizerand reports 1.0. - Score column
deployment_datewith1980-04-03. A date result scores 1.0 under runtime nameValidatedDateRecognizer, but recognizer metadata is absent because the configured name isDateRecognizer.
These observations are from a fixed-input processor/scorer replay; server persistence was not tested.
Expected behavior
For the content path, the recognizer ID, name, score, and matched patterns in TagLabel.metadata.recognizer should describe the result responsible for the candidate's score. In the first case, metadata should identify PhoneRecognizer at 1.0. In the second, it should resolve the configured DateRecognizer ID and retain the date result's score.
Cover competing scores, score ties, runtime wrappers, and a single-recognizer control. Keep emitted tag decisions and scores unchanged. The existing recognizer metadata fields are sufficient; this correction does not require a schema or database change.
OpenMetadata version
main at ba688d6058
Additional context
Parent: #33827. Relevant code: TagAnalyzer.analyze and TagScorer._build_recognizer_metadata. Existing tag records are not repaired by this change.
Pre-submission checklist
- I searched for duplicate issues.
- I removed credentials, hostnames, emails, and other sensitive data from logs and config.
Source: open-metadata/OpenMetadata