Skip to content

Fixes 34972: Recover valid tags beside malformed definitions - #34973

Merged
stout-yeoman merged 2 commits into
mainfrom
stout-yeoman/classification-skip-malformed-recovery
Oct 13, 2026
Merged

stout-yeoman merged 2 commits into
mainfrom
stout-yeoman/classification-skip-malformed-recovery

Conversation

@stout-yeoman

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

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #34972

Related to open-metadata/openmetadata-collate#7111 (partial fix: recovers valid tags; saved warnings and remaining diagnostics are tracked separately in #34824).

One malformed recognizer currently prevents valid tags from the same classification from loading. Opt the two existing ClassificationManager.list_all_entities calls into the SDK's existing skip_on_failure=True behavior so valid PII still classifies ACCT_NUM beside SPI missing supportedLanguage, and loading continues through invalid entities and pages.

This is the minimal recovery stage extracted from #34865. The complete scope remains tracked in #34824: saved loading warnings, cleaner diagnostics, fetch resilience, and cache correctness are separate further work. Existing SDK parsing-error logs are reused; saved loading-warning counts and behavior after a later network failure are unchanged.

Type of change:

  • Bug fix

High-level design:

Small change: exactly two production lines in classification_manager.py, plus focused regression tests and an existing mock signature update to accept the skip flag. Strict SDK defaults, filtering, enablement, scoring, and cache behavior are preserved.

Tests:

Use cases covered

  • Real SDK parsing loads valid PII and produces its ACCT_NUM column tag label beside malformed SPI; the all-valid control loads both tags.
  • Valid selected classifications survive malformed definitions in either order, with existing filters and disabled-classification checks preserved.
  • Valid tags before and after an entirely invalid middle page survive, and another selected classification still loads.

Unit tests

  • Added regressions in ingestion/tests/unit/metadata/pii/test_classification_manager.py and ingestion/tests/unit/metadata/pii/test_tag_processor.py.
  • Before the production change: 4 malformed-data cases failed; the all-valid control passed.
  • After the change: both affected modules passed, 32 tests, with 100% line coverage for metadata.pii.classification_manager (65 statements, zero missed).
  • make py_format_check passed across ingestion and airflow APIs (3023 files formatted); targeted basedpyright on the changed production module passed with zero errors or warnings; git diff --check passed.

Python 3.11, generated models, Presidio 2.2.358, NumPy 2.2.6, and spaCy en_core_web_md 3.8.0 were used. Test transport is mocked; SDK parsing and tag scoring are real. The new column-name regression supplies the NLP boundary explicitly and needs no model download.

Reproduce from the repository root with the ingestion test dependencies installed:

source env/bin/activate
PYTHONPATH=ingestion/src PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m coverage run \
  --source=metadata.pii.classification_manager -m pytest \
  ingestion/tests/unit/metadata/pii/test_classification_manager.py \
  ingestion/tests/unit/metadata/pii/test_tag_processor.py -q
python -m coverage report --include='*/classification_manager.py'

Backend integration tests

Not applicable: no backend API changes.

Ingestion integration tests

Live local-stack validation completed on 2026-10-08 using this PR's exact head 93527031dbe3433c0911ab43adcc8aa6039c231b. A freshly generated, noneditable ingestion wheel ran inside an isolated Python 3.11 Docker environment against the existing upstream OpenMetadata 2.0.0-SNAPSHOT server (revision cc5b208051307c5ec76efcd7797db065660a350e) and a disposable PostgreSQL 16 source.

  • Real metadata ingestion created the source table and columns.
  • Baseline with only the two flags removed reproduced dropped tags: ACCT_NUM remained untagged while the saved pipeline reported Success, zero warnings, zero errors.
  • The exact minimal fix persisted the valid PII column tag beside SPI missing supportedLanguage.
  • The all-valid control and pagination through a malformed-only middle page also passed, with valid later-page tags persisted.
  • All five CLI commands exited 0. Normalized column tags and actual run-ID pipeline statuses were independently verified through server read-back.
  • The saved loading-warning count remains zero, as expected for this minimal patch.
  • Both affected unit modules also passed in the packaged Docker runtime: 32 tests.

Only the owned malformed tag's raw HTTP response and the pagination request size were controlled. The source connector, SDK parsing, workflow, scoring, sink, status upload, and persistence were real. The baseline alteration affected only the isolated installed manager and was restored/hash-verified afterward. The repository code stayed unchanged. All owned server/source fixtures were deleted, existing PII tags were preserved, and the stack's original running/stopped state was restored.

No live UI, scheduler/Airflow deployment, or later network-failure resilience was tested. Runtime dependencies were reused from an existing upstream environment; this is not fresh release dependency resolution certification.

Playwright (UI) tests

Not applicable: no UI changes.

Manual testing performed

Reviewed the diff against current main (545614e388), reproduced the malformed-data failures before the flags, and verified passing recovery tests afterward. Confirmed the production diff is exactly the two skip flags. The subsequent live server ingestion/classification runs and cleanup are described above; no live UI verification was performed.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • Read the repository contribution guidance.
  • PR title follows Fixes <issue-number>: <short explanation>.
  • PR links to the separate bug-fix issue via Fixes #34972.
  • Focused regression tests cover the reported scenario and fail before the fix.
  • Relevant runtime tests, coverage, formatting, and production-module type checks passed.
  • Schema, migration, UI recording, and new API/connector integration requirements: not applicable.

GitHub checks

The safe to test label has been added to enable normal Python CI. The remaining PR metadata requirement is to add #34972 to Shipping with the inherited customer-issue fields documented there. The current GitHub token lacks the project write scope; an authorized project editor must set the fields and re-run the metadata check.

@stout-yeoman
stout-yeoman requested a review from a team as a code owner October 8, 2026 20:17
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@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!

@TeddyCr
TeddyCr enabled auto-merge October 12, 2026 21:39
@gitar-bot

gitar-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Enabling skip_on_failure for classification and tag loading lets ingestion pass malformed definitions, which could omit their recognizers and leave matching sensitive columns untagged.

Fixes malformed classification definitions blocking valid tags from loading by enabling skip_on_failure=True in two ClassificationManager.list_all_entities calls. Valid PII now classifies alongside malformed entries, with comprehensive regression tests covering real SDK parsing, pagination, and tag scoring at 100% line coverage. No issues found.

Verification

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

@TeddyCr
TeddyCr added this pull request to the merge queue Oct 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-13T00:15:54Z)

Blocked the queue: playwright-summary

Failed Playwright tests:

  • Features/TagsSuggestion.spec.ts › should add and accept requested tags for a topic schema field

@stout-yeoman
stout-yeoman added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit 6f86181 Oct 13, 2026
72 of 73 checks passed
@stout-yeoman
stout-yeoman deleted the stout-yeoman/classification-skip-malformed-recovery branch October 13, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-classification: recover valid tags by skipping malformed definitions

2 participants