refactor(qn): centralise Metabase qualifiedName grammar to clear scattered P028#221
Merged
Merged
Conversation
…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 PR Reviewer is ready. Comment |
Contributor
Tests Summary
Overall: ✅ All passed — view run |
Contributor
🛡️ Security Gate PassedTrivy: 0 | Total: 0 CRITICAL/HIGH | All allowlisted ✅ Run: 29566994950 | Fri, 17 Jul 2026 08:38:41 GMT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Metabase
qualifiedNamegrammar was re-inlined in three places —asset_mapper.py,extracts/process.py, andlineage/ars_builder.py— producing 11 P028ManualQualifiedNameFStringfindings 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.pyowns every Metabase QN shape; all callers route through it.collection/dashboard/question/bi_process): the 7 re-inlined reference/transformer sites inprocess.py(2) andars_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.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.
detect --series Pconfirms 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.