Skip to content

[2.0] Fixes #38334: MicroStrategy column lineage for schema cube metrics - #38336

Merged
Khairajani merged 6 commits into
2.0from
mstr-metric-column-lineage-2.0
Nov 24, 2026
Merged

Khairajani merged 6 commits into
2.0from
mstr-metric-column-lineage-2.0

Conversation

@Khairajani

@Khairajani Khairajani commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #38334

Backport of #38335 to 2.0. A clean cherry-pick: the connector code is identical to main. 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:

  • Improvement

Tests:

Checklist:

  • My PR title is [2.0] Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have added tests and listed them above.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The PR still needs the previously reported fix for failed definition reads assigning the wrong source columns.

Findings

  1. P1 Failed reads cause wrong lineage ▶

Summary

Adds column-level lineage for metrics in schema-based MicroStrategy cubes.

  • Schema-cube metrics now link to the warehouse columns that feed them.

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 --> G
Loading

Reviews (10) · Last reviewed commit: "MicroStrategy: match a metric's SQL proj..." · Reviewed by Greptile

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.
@Khairajani
Khairajani requested review from a team as code owners November 20, 2026 20:05
@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Nov 20, 2026
@Khairajani
Khairajani requested review from harshsoni2024 and shrabantipaul-collate and removed request for a team November 20, 2026 20:05
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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.

…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.
@gitar-bot

gitar-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Adding 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.

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 526ddbe into 2.0 Nov 24, 2026
67 of 70 checks passed
@Khairajani
Khairajani deleted the mstr-metric-column-lineage-2.0 branch November 24, 2026 09:49
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.

1 participant