Skip to content

Fixes #38161: Apply recognizer exceptions to columns whose name contains a dot - #38162

Merged
Khairajani merged 3 commits into
open-metadata:mainfrom
vamsibvv:fix/recognizer-exception-dotted-column
Nov 25, 2026
Merged

Khairajani merged 3 commits into
open-metadata:mainfrom
vamsibvv:fix/recognizer-exception-dotted-column

Conversation

@vamsibvv

@vamsibvv vamsibvv commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #38161

TagAnalyzer.should_skip_recognizer built the column's entity link by splitting the column FQN on every .. That broke a quoted name apart (svc.db.sch.users."user.email" gave <#E::table::svc.db.sch.users."user::columns::email">) and put a nested column's parent into the table name, so no exception for those columns could match.

It now goes the other way: _column_fqn_named_by turns each exception link into the column FQN it names (table FQN, ., column path), and that's compared with the column's FQN. The link addresses the column like a test case link does (ADR:2026-10-27-nested-column-dq-tests-address-nested-paths): a nested column as a dotted path (contact.email) and a name with a dot in it quoted ("user.email"). A bare user.email names only the nested column: the analyzer can't see the table's other columns, so reading it as the literal name too could let an exception for a nested field silence an unrelated column. The rule is in docs/decisions/2026-11-19-recognizer-exception-links-address-columns-like-test-case-links.md. Plain column names match as before.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • A recognizer exception whose link names "user.email" skips the column named user.email.
  • With a column named user.email and a nested user > email in the same table, a link with the bare user.email skips only the nested one.
  • An exception for email or user in the same table does not skip user.email.
  • An exception for a nested column (contact.email) skips that column, and one for its parent (contact) does not.
  • An exception on a column of a table whose name contains a dot (svc.db.sch."users.v2") still applies.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: tests/unit/metadata/pii/test_tag_scoring.py
  • The dotted-column and nested-column cases fail on main and pass with this change. The rest of test_tag_scoring.py gives the same results as on main in my environment.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not run: no connector changes.

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. Ran should_skip_recognizer for a column FQN svc.db.sch.users."user.email" with an exception on user.email: False on main, True with this change. ruff format --check and ruff check pass on the changed files.

UI screen recording:

Not applicable — ingestion-only bug fix.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Decision check: added docs/decisions/2026-11-19-recognizer-exception-links-address-columns-like-test-case-links.md.
  • I have added a test that covers the exact scenario we are fixing.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

Recognizer exceptions now match column names without splitting quoted names or confusing nested fields with literal dotted names.

  • Recognizer exceptions now match columns with quoted dots and nested paths.

The previous finding is addressed. No new actionable issues found. Tests were not run during this review.

Reviews (3) · Last reviewed commit: "Read an unquoted dotted path in an excep..." · Reviewed by Greptile

…se name contains a dot

should_skip_recognizer split the column FQN on every dot, so a quoted column name such as "user.email" was broken apart and the entity link it built never matched an exception. It now splits only on separators outside quotes and accepts the column name as is or quoted.
@vamsibvv
vamsibvv requested a review from a team as a code owner November 18, 2026 20:21
@vamsibvv
vamsibvv requested a review from Khairajani November 18, 2026 20:21
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

Each exception link is turned into the column FQNs it can name and compared with the column's FQN, so a nested column (contact.email) is matched as well as a name with a dot in it. Adds ADR:2026-11-19-recognizer-exception-links-address-columns-like-test-case-links.
…only

The analyzer cannot see the table's other columns, so a bare user.email is read as the nested path, as it would be first for a test case; a column whose own name has a dot must be quoted in the link. Adds a test with both columns and updates the decision record.
@gitar-bot

gitar-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Matching exception links to dotted or nested column FQNs changes which columns bypass PII recognizers, potentially leaving configured columns unscanned.

Fixes recognizer exception matching for columns whose names contain a dot by comparing each exception link's resolved column FQN against the column's FQN, so quoted names like "user.email" and nested paths like contact.email now match correctly. The previously unrecorded rule for quoted versus unquoted dotted links has been resolved and documented in the decision record.

✅ 1 closed
✅ Quality: Unrecorded rule: exception links may quote a dotted column or not

📄 ingestion/src/metadata/pii/tag_analyzer.py:145-154 📄 ingestion/tests/unit/metadata/pii/test_tag_scoring.py:710-724
The PR decides how the entity link of a recognizer exception names a column whose name contains a dot, and other components have to agree with that format. Feedback clients send the link, and RecognizerFeedbackRepository.addExceptionToRecognizer stores it unchanged. The description gives the rule only in prose: "checks the exception links with the column name both as is (user.email) and quoted ("user.email"), since I couldn't find one format every client uses" and "A quoted table name keeps its quotes, as in the table's FQN." The repo squash-merges, so the PR description never reaches git log, and no record in docs/decisions/ states this rule. 2026-10-27-nested-column-dq-tests-address-nested-paths.md covers only DQ test-case links. The record would say: "A recognizer exception's entityLink names the table by its FQN, keeping quotes on table segments, and names a column with a dot in its name either quoted ("a.b") or unquoted (a.b). The ingestion TagAnalyzer.should_skip_recognizer accepts both forms. Guard: test_exception_list_filtering_*_with_a_dot." It should also say whether servers and UIs should write one canonical form from now on.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@Khairajani
Khairajani merged commit c464b2d into open-metadata:main Nov 25, 2026
54 of 57 checks passed
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.

Recognizer exceptions are ignored for a column whose name contains a dot

3 participants