Repository navigation
Description
Affected module
Ingestion Framework / Auto-classification
Problem and complete scope
ClassificationManager currently loads classifications and tags using strict SDK parsing. One malformed recognizer can discard valid tags from the same classification, and the saved run summary can still show success with no loading warnings. Separately, a later fetch failure can discard already loaded candidates, incomplete results can become cached, and string-based cache keys can collide.
Example: valid enabled PII has a column-name pattern matching ACCT_NUM, while enabled SPI has a pattern recognizer missing supportedLanguage. SPI prevents valid PII from loading. Recovery, saved reporting, fetch resilience, and cache correctness are distinct concerns and should be reviewed and delivered separately.
The broader implementation proposal is #34865. The direct recovery fix is tracked in #34972 and proposed in #34973; its completion does not close this issue. This issue remains the complete scope tracker for the further work below.
Reproduction
- Configure an enabled classification containing valid PII and SPI missing
supportedLanguage. - Run auto-classification with confidence 80 against a table containing
ACCT_NUM. - Observe the validation error, missing valid candidate and tag label, and a clean saved run summary.
If server validation prevents saving malformed data, reproduce at the mocked HTTP-response boundary with real SDK parsing and generated models. Recovery must support invalid definitions already stored or returned by older servers.
Workstream 1: Minimal recovery (separate bug-fix issue/PR)
- Add
skip_on_failure=Trueto the two existing classification/taglist_all_entitiescalls. - Preserve existing filtering, enablement, recognizer selection, and strict SDK defaults for other callers.
- Verify PII still classifies
ACCT_NUMbeside malformed SPI, the all-valid control, valid neighbors, pagination through an entirely invalid page, malformed classifications, and other selected classifications.
This uses the existing SDK parsing-error logs. It requires no SDK implementation or server changes and does not add saved loading-warning counts or improve behavior after later fetch failures. See #34972 for delivery and acceptance criteria.
Workstream 2: Saved loading warnings and useful diagnostics
- Add an optional
on_parse_errorcallback to SDK entity listing and forward it through every page. Without a callback, preserve strict parsing by default and existing skip-mode logging. HTTP, pagination, and callback errors must propagate rather than become entity skips. - Pass
TagProcessor.statusinto its default manager while preserving injected-manager compatibility and updating fixed-signature mocks. - Record relevant malformed-definition diagnostics with
Status.warning(...), including identifiable entity names and safe, useful messages. Omit raw payloads, recognizer patterns, exception values, and control characters from callback-owned logs and saved details. - Ignore clearly disabled malformed entities and classifications outside the workflow filter. Do not suppress warnings when invalid selection fields prevent determining relevance; handle quoted names/FQNs consistently with normal loading.
- Start with a safe warning naming the malformed tag. Precise recognizer/field explanations are a separate refinement: identify the failing recognizer, select and revalidate the correct recognizer-union branch, strip synthetic union-path labels, and report a useful field path such as
supportedLanguageorpatterns[0]. - Verify warning counts in the actual saved pipeline-status payload and existing Tag Classification Processor → Logs display, including the existing first-10 detail limit with the full count retained.
Acceptance: valid PII labels are produced alongside one relevant SPI loading warning per malformed definition, without duplicate callback/SDK diagnostics or raw input values. Parsing warnings do not reduce success-threshold calculations: an otherwise healthy run remains Success, including when no successful processor records were produced. Repairing SPI removes the warning. Excluded/disabled definitions do not add warnings.
Workstream 3: Fetch resilience and retry reporting
- Preserve valid classifications/tags yielded before a later HTTP, transport, timeout, or pagination failure; continue processing other selected classifications.
- Record fetch failures with
Status.failed(StackTraceError(...)), using a safe reason such as HTTP status or timeout rather than response bodies or raw exception values. - Return incomplete loads uncached so later calls retry. Cache only completed loads, including completed empty results.
- Deduplicate repeated parsing/fetch diagnostics with bounded storage; clear diagnostic state with the manager caches. Specify and test what a retry reports when the failure changes.
- Cover partial classification/tag fetches, retries, completed empty-cache hits, repeated malformed definitions across pages, and callback/HTTP/pagination exception propagation.
Acceptance: already loaded valid candidates survive a later fetch failure. A later successful retry refreshes the candidates. Existing success-threshold behavior applies to fetch failures, not parsing warnings. At threshold 90, with one fetch failure and otherwise healthy steps, 0, 1, or 5 successful processor records yields Failed; 20 yields Partial success. Valid tagging continues before terminal status is evaluated.
Workstream 4: Cache correctness (separate from recovery/reporting)
- Bound classification, tag, and diagnostic caches (the current proposal uses 256 entries) and verify eviction.
- Use structured cache keys: distinguish the unfiltered selection from a classification literally named
all, and distinguish one name containing a comma from two separate names. - Preserve order-independent selection caching, completed empty-result caching, and explicit cache clearing.
- Verify collisions and bounds independently of malformed-recognizer recovery.
These are separate correctness improvements and are not necessary to deliver the two-flag recovery fix. Do not bundle them into its PR.
Architecture and verification
Primary code: ingestion/src/metadata/pii/classification_manager.py, ingestion/src/metadata/ingestion/ometa/ometa_api.py, and ingestion/src/metadata/pii/tag_processor.py.
Reuse existing status serialization, pipeline-status upload, warning/failure rendering, and threshold calculations. No new per-tag server request, endpoint, schema, or UI component is expected. Saved diagnostics require an associated ingestion pipeline; standalone runs retain local reporting.
Keep transport-boundary tests using real SDK parsing, generated models, and actual column-name scoring. Verify unit tests and coverage for each delivery; separately record live pipeline/UI validation when performed. Moving diagnostic helpers into another file is an organization change and does not by itself reduce scope or validation requirements.
Related work
This tracks shared OpenMetadata ingestion changes for Collate issue 7111. Server-side recognizer validation remains separate in Collate issue 7110.
Activity
[-]Auto-classification: preserve valid tags and report loading failures[/-][+]Auto-classification: recovery, loading diagnostics, fetch resilience, and cache correctness[/+]