Repository navigation
[2.0] Fixes #38334: MicroStrategy column lineage for schema cube metrics - #38336
Conversation
A metric is linked to the columns of the SQL projection named after it, else through the metrics and facts its definition is built from.
❌ PR checklist incompleteThis 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 |
…and load on Python 3.11 A metric the definition references now matches an alias only when no other object of the dataset shares its name, as the metric's own name already did. The ParsedCube alias default moves to a factory, since Python 3.11 refuses an unhashable dataclass default.
…ct owns that name A metric a definition references, but the dataset does not hold, could take the alias of a dataset object whose name normalizes the same. Aliases are now matched by object id: an alias is a metric's only when no other object of the dataset has that name.
A metric can set a column alias that the SQL generator names its projection after in place of its name, so a display name can match another metric's projection. Each metric's alias now comes from its definition, every dataset object claims the name it is projected under before any metric is matched, and referenced metrics are matched on their own alias. Without modeling privileges the name stands in for the alias.
A metric whose definition fails to read dropped out of the alias claims, so another metric sharing its name could take its projection. It now claims its name, blocking that match without getting a column edge itself.
… be read Without modeling privileges a metric's column alias is unknown, so matching its name could take a projection another metric's alias names. Metrics now get no column edge then; they still claim their names, so no other metric takes those projections.
Code Review ✅ Approved 🟡 Medium riskAdding schema-cube metric column lineage changes lineage reporting; incorrect alias or definition mapping could attribute metrics to the wrong warehouse columns. Adds column-level lineage for metrics in schema-based MicroStrategy cubes, linking each metric to the warehouse columns that feed it through its column alias projection or its referenced metrics and facts. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #38334
Backport of #38335 to
2.0. A clean cherry-pick: the connector code is identical tomain. Metrics of schema-based MicroStrategy cubes get column-level lineage. A metric is linked through the SQL projection named after its column alias (or its name when none is set), or else through the metrics and facts its definition is built from. A projection is a metric's only when no other dataset object claims it. Metric column lineage needs Architect read.Type of change:
Tests:
Checklist:
[2.0] Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code
The PR still needs the previously reported fix for failed definition reads assigning the wrong source columns.
Findings
Summary
Adds column-level lineage for metrics in schema-based MicroStrategy cubes.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Schema cube metric] --> B[Read metric definition] B --> C{Owns a matching SQL alias?} C -->|Yes| D[Use columns read by that projection] C -->|No| E[Follow referenced metrics and facts] E --> F[Keep columns also read by cube SQL] D --> G[Add column lineage] F --> GReviews (10) · Last reviewed commit: "MicroStrategy: match a metric's SQL proj..." · Reviewed by Greptile