Skip to content

Fixes 34824: Add classification loading diagnostics, fetch resilience, and cache correctness - #34865

Draft
stout-yeoman wants to merge 3 commits into
mainfrom
stout-yeoman/34824-preserve-valid-tags-report-loading-failures
Draft

stout-yeoman wants to merge 3 commits into
mainfrom
stout-yeoman/34824-preserve-valid-tags-report-loading-failures

Conversation

@stout-yeoman

@stout-yeoman stout-yeoman commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #34824

A malformed recognizer currently causes auto-classification to discard valid tags from the same classification, while the saved run can still show no errors. This change keeps valid candidates and records relevant classification/tag parsing warnings and fetch failures through the processor's existing run status. For example, PII can still classify ACCT_NUM when SPI is missing supportedLanguage, and the run records an actionable SPI loading warning.

Type of change:

  • Bug fix

High-level design:

  • Add an optional on_parse_error callback to SDK entity listing and forward it through every page. Strict parsing remains the default, existing skip-mode logging remains when no callback is supplied, and HTTP, pagination, and callback exceptions propagate.
  • Opt classification and tag loading into skipping malformed entities. Pass the default manager the processor's Status so relevant failures appear in existing pipeline-status serialization and failure rendering. Malformed definitions use saved warnings; fetch failures use saved failures. Parsing warnings preserve success-threshold calculations, while fetch failures retain the existing threshold semantics. Diagnostics identify the entity, recognizer, and missing/invalid field without raw payload or exception values; clearly disabled or excluded entities are ignored. Precise recognizer/field explanations require generated-model inspection and revalidation; a simpler safe warning naming the malformed tag can be reviewed independently.
  • Preserve valid candidates already yielded before a fetch failure. Cache only completed loads, including empty results, using bounded caches so later calls retry incomplete loads and completed cache hits do not duplicate diagnostics. Structured cache keys distinguish an unfiltered request from the literal name all, and a comma-containing name from two separate names; these fixes are additional cache correctness work, separate from recovery.

This reuses the existing status upload and success-threshold behavior. There are no server API, schema, or UI changes; saved diagnostics require an associated ingestion pipeline.

Tests:

Use cases covered

Regression tests cover valid neighbors around malformed tags, all-invalid middle pages, classification filters and enablement, recognizer-specific diagnostics, strict SDK defaults, propagation of callback/HTTP/paging errors, bounded caches, completed empty loads, partial results and retries. Processor tests exercise real SDK parsing, ACCT_NUM pattern classification, pipeline-status upload, success-threshold calculations, and the first-10 detail limit with the full diagnostic count retained.

Unit tests

  • Regression tests added/updated in test_classification_manager.py, test_tag_processor.py, and test_ometa_listing_parse_errors.py.
  • Validation during PR preparation: Python syntax checks passed for all six changed Python files; git diff --check origin/main...HEAD passed.
  • The unit suite was not run during PR preparation: the available local Python environments lack pytest or pydantic. Runtime test results and coverage remain to be verified by CI or a configured ingestion environment.

Targeted command:

PYTHONPATH=ingestion/src python -m pytest \
  ingestion/tests/unit/metadata/pii/test_classification_manager.py \
  ingestion/tests/unit/metadata/pii/test_tag_processor.py \
  ingestion/tests/unit/sdk/test_ometa_listing_parse_errors.py -q

Backend integration tests

Not applicable: no backend API changes.

Ingestion integration tests

No live ingestion integration run was performed during PR preparation. Added unit tests exercise generated models, real SDK parsing, scoring, and the existing pipeline-status upload boundary with mocked transport.

Playwright (UI) tests

Not applicable: no UI changes. Existing failure rendering is reused; live UI verification remains outstanding.

Manual testing performed

Current reviewed head is 4065ac475ed736a0f99c1d55715ae6385cd4994a: three commits and seven changed files. No code changes were made while splitting the issue and creating #34973. Its passing tests validate only the minimal recovery branch; they do not verify this broader head. No live server or UI verification was performed during PR preparation.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • PR title follows Fixes <issue-number>: <short explanation>.
  • PR links to the issue via Fixes #34824.
  • Regression tests cover the reported malformed-recognizer scenario.
  • Runtime tests and coverage verified during PR preparation.
  • Live ingestion and existing Logs rendering verified.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment on lines +159 to +163
if warning:
logger.warning(message)
if self.status is not None:
self.status.warning(name, message)
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: Parse diagnostics as warnings never reach the saved run

This commit now reports classification and tag parse errors with status.warning(...) instead of status.failed(...). When the pipeline status is built (step.py:130), only warnings=len(step.status.warnings) is uploaded, and the warning text is dropped. The test confirms this: uploaded.status.root[0].failures is None. As a result, the saved run shows success with a bare warning count. The text naming the tag, recognizer and missing field (e.g. PII.SPI … supportedLanguage) only appears in the logs. That goes against the PR's stated goal that the run records an actionable SPI loading failure through the existing failure rendering, and it brings back the original complaint from #34824 that the stored run gives no usable detail. Two possible fixes: keep the diagnostic in failures, accepting the hit to the success threshold, or also record it as a StackTraceError entry that gets uploaded without counting as an error. Otherwise, update the PR description and tests to state that the details now live only in the logs.

Was this helpful? React with 👍 / 👎

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 0 closed / 1 findings

🟡 Medium risk · Skipping malformed tags while preserving valid candidates could leave some columns without intended classifications, despite the run continuing with partial results.

Fixes auto-classification to preserve valid tags when recognizers are malformed and report failures through the processor's run status. However, parse diagnostics are logged as warnings rather than failures, so they do not persist in the saved run—only in logs—which contradicts the stated goal of making failures actionable in pipeline-status rendering. Update the diagnostic handling to record failures or StackTraceError entries that reach the saved run, or revise the PR description to reflect that details appear in logs only.

⚠️ Bug: Parse diagnostics as warnings never reach the saved run

📄 ingestion/src/metadata/pii/classification_manager.py:159-163 📄 ingestion/src/metadata/pii/classification_manager.py:188 📄 ingestion/src/metadata/pii/classification_manager.py:207-212 📄 ingestion/tests/unit/metadata/pii/test_tag_processor.py:403-406

This commit now reports classification and tag parse errors with status.warning(...) instead of status.failed(...). When the pipeline status is built (step.py:130), only warnings=len(step.status.warnings) is uploaded, and the warning text is dropped. The test confirms this: uploaded.status.root[0].failures is None. As a result, the saved run shows success with a bare warning count. The text naming the tag, recognizer and missing field (e.g. PII.SPI … supportedLanguage) only appears in the logs. That goes against the PR's stated goal that the run records an actionable SPI loading failure through the existing failure rendering, and it brings back the original complaint from #34824 that the stored run gives no usable detail. Two possible fixes: keep the diagnostic in failures, accepting the hit to the success threshold, or also record it as a StackTraceError entry that gets uploaded without counting as an error. Otherwise, update the PR description and tests to state that the details now live only in the logs.

🤖 Prompt for agents
Code Review: Fixes auto-classification to preserve valid tags when recognizers are malformed and report failures through the processor's run status. However, parse diagnostics are logged as warnings rather than failures, so they do not persist in the saved run—only in logs—which contradicts the stated goal of making failures actionable in pipeline-status rendering. Update the diagnostic handling to record failures or `StackTraceError` entries that reach the saved run, or revise the PR description to reflect that details appear in logs only.

1. ⚠️ Bug: Parse diagnostics as warnings never reach the saved run
   Files: ingestion/src/metadata/pii/classification_manager.py:159-163, ingestion/src/metadata/pii/classification_manager.py:188, ingestion/src/metadata/pii/classification_manager.py:207-212, ingestion/tests/unit/metadata/pii/test_tag_processor.py:403-406

   This commit now reports classification and tag parse errors with `status.warning(...)` instead of `status.failed(...)`. When the pipeline status is built (`step.py:130`), only `warnings=len(step.status.warnings)` is uploaded, and the warning text is dropped. The test confirms this: `uploaded.status.root[0].failures is None`. As a result, the saved run shows success with a bare warning count. The text naming the tag, recognizer and missing field (e.g. `PII.SPI … supportedLanguage`) only appears in the logs. That goes against the PR's stated goal that the run records an actionable SPI loading failure through the existing failure rendering, and it brings back the original complaint from #34824 that the stored run gives no usable detail. Two possible fixes: keep the diagnostic in `failures`, accepting the hit to the success threshold, or also record it as a `StackTraceError` entry that gets uploaded without counting as an error. Otherwise, update the PR description and tests to state that the details now live only in the logs.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@stout-yeoman stout-yeoman self-assigned this Oct 8, 2026
@stout-yeoman stout-yeoman changed the title Fixes 34824: Preserve valid tags and report auto-classification loading failures Fixes 34824: Add classification loading diagnostics, fetch resilience, and cache correctness Oct 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-classification: recovery, loading diagnostics, fetch resilience, and cache correctness

1 participant