Skip to content

refactor(qn): centralise Metabase qualifiedName grammar to clear scattered P028#221

Merged
vaibhavatlan merged 1 commit into
mainfrom
fix/p028-centralize-qn-helpers
Jul 22, 2026
Merged

refactor(qn): centralise Metabase qualifiedName grammar to clear scattered P028#221
vaibhavatlan merged 1 commit into
mainfrom
fix/p028-centralize-qn-helpers

Conversation

@vaibhavatlan

Copy link
Copy Markdown
Collaborator

Why

The Metabase qualifiedName grammar was re-inlined in three places — asset_mapper.py, extracts/process.py, and lineage/ars_builder.py — producing 11 P028 ManualQualifiedNameFString findings for the same handful of QN shapes. That scatter is what P028 targets: change the grammar once and every site breaks independently. These are true positives, not a rule bug (they're indistinguishable from P028's canonical target), so the fix is in the app: one source of truth.

What

New app/qualified_names.py owns every Metabase QN shape; all callers route through it.

  • Asset QNs (collection/dashboard/question/bi_process): the 7 re-inlined reference/transformer sites in process.py (2) and ars_builder.py (5) now call the shared builders → their P028 warnings clear. The 4 builder definitions still trip P028 because pyatlan_v9 ships no .creator() for the Metabase family yet (BLDX-1558 / atlan-python#975) — left as warnings, now in one place, ready to become thin .creator() wrappers once that lands.
  • Lineage-process QNs (question_tables/question_columns + content hash): bespoke ARS identities with no pyatlan creator equivalent → centralised with one justified # conformance: ignore[P028] each.

Safety

Pure refactor — the helpers return byte-identical strings (asserted for all 6 shapes); no wire/qualifiedName change.

before after
P028 11 warn 4 warn + 2 justified suppressions
  • Lineage / process / mapper / transform tests: 107 passed.
  • detect --series P confirms the 7 scattered sites cleared. Pre-commit clean.

Separate from the P012 and E009 PRs; expect a trivial rebase if another contracts.py/app PR merges first.

…tered P028

The connector re-inlined the Metabase qualifiedName grammar in three places
(asset_mapper, extracts/process, lineage/ars_builder) — 11 P028 findings for the
same handful of QN shapes. That scatter is exactly what P028 targets: a single
grammar change would break each site independently.

Add app/qualified_names.py as the single source of truth and route every caller
through it:
- Metabase asset QNs (collection/dashboard/question/bi_process) — the 7 re-inlined
  reference/transformer sites in process.py and ars_builder.py now call the shared
  builders, so their P028 warnings clear. The 4 builder definitions still trip P028
  (pyatlan_v9 has no .creator() for the Metabase family yet — BLDX-1558 /
  atlan-python#975); they stay as warnings, now in one place.
- Lineage-process QNs (question_tables/question_columns + content hash) — bespoke
  ARS identities with no pyatlan creator equivalent; centralised with one justified
  ignore[P028] each.

Pure refactor: the helpers return byte-identical strings (asserted), no wire change.
P028: 11 warnings -> 4 warnings + 2 justified suppressions. Lineage/process/mapper
tests: 107 passed. Pre-commit clean.
@mothership-reviewer

Copy link
Copy Markdown

👋 Mothership PR Reviewer is ready.

Comment @mothership-reviewer run to start an AI code review.
Or add the label request-mothership-review to this PR.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tests Summary

Job Status Result
tests ✅ Passed 350 passed, 1 skipped, 2 warnings in 80.50s (0:01:20)
e2e ⊘ Skipped — add e2e label to trigger per-suite results + live logs in the run

Overall: ✅ All passed — view run

@github-actions

Copy link
Copy Markdown
Contributor

🛡️ Security Gate Passed

Trivy: 0 | Total: 0 CRITICAL/HIGH | All allowlisted ✅

Run: 29566994950 | Fri, 17 Jul 2026 08:38:41 GMT

@mothership-reviewer mothership-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security Reviewer — Approve

Score Decision Critical High Medium
70/100 ✅ Approve 0 0 0

@vaibhavatlan
vaibhavatlan added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit dbd5f5f Jul 22, 2026
37 of 39 checks passed
@vaibhavatlan
vaibhavatlan deleted the fix/p028-centralize-qn-helpers branch July 22, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant