Skip to content

[2.0] Fixes #37978: MicroStrategy reads a report dataset's lineage from its source cube - #37980

Merged
Khairajani merged 3 commits into
2.0from
mstr-cube-report-source-2.0
Nov 19, 2026
Merged

Khairajani merged 3 commits into
2.0from
mstr-cube-report-source-2.0

Conversation

@Khairajani

@Khairajani Khairajani commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37978

Backport of #37979 to 2.0: a MicroStrategy dataset that is a report built on an Intelligent Cube gets the cube's lineage, and the warnings for warehouse reports, prompted reports and Live cubes say why they have no lineage. A clean cherry-pick; the connector code is identical to main.

Type of change:

  • Bug fix

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


Summary by Gitar

  • Report lineage:
    • Reports built on an Intelligent Cube read the source cube's SQL through CubeSql and get_report_cube
    • The source cube is cached alongside its parsed SQL, so lineage survives report cache eviction
  • Data Import matching:
    • Reports on Data Import cubes are matched by the source cube's subtype via sql_cube
  • Warnings:
    • Live Intelligent Cubes and warehouse or prompted reports log why they have no lineage
  • Docs:
    • Added a decision record amendment and updated the MicroStrategy connector guide

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the source cube stays attached to its SQL across cache eviction.

Summary

MicroStrategy report datasets now read lineage from their source Intelligent Cube.

  • Reports built on Intelligent Cubes get lineage from their source cube.
  • Warnings explain why warehouse reports and Live cubes have no lineage.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Report dataset] --> B[Read source cube]
  B --> C[Cache SQL with cube ID]
  C --> D[Parse tables and columns]
  D --> E[Use cube subtype to match columns]
  E --> F[Report data model lineage]
Loading

Reviews (4) · Last reviewed commit: "MicroStrategy: cache a report's source c..." · Reviewed by Greptile

@Khairajani
Khairajani requested review from a team as code owners November 17, 2026 12:19
@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Nov 17, 2026
@Khairajani
Khairajani requested review from ulixius9 and removed request for a team November 17, 2026 12:19
@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Nov 17, 2026
@Khairajani
Khairajani requested review from ShaileshParmar11 and removed request for a team November 17, 2026 12:19
@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.

…nly in an evictable cache

(cherry picked from commit 1b07f4f)
The report and parse caches could evict a report while the SQL cache still
held it, so the report was matched as a schema cube and lost its column pairs.
@gitar-bot

gitar-bot Bot commented Nov 19, 2026

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

Reading report lineage from its source cube changes dependency attribution; an incorrect source mapping could misstate downstream data lineage.

MicroStrategy report datasets now inherit lineage from their source Intelligent Cube, with the cube kept alongside its parsed SQL so lineage survives report cache eviction. Two resolved findings covered cube loss after eviction, and no open issues remain.

✅ 2 closed
✅ Edge Case: cube_behind can lose a report's cube once _report_cubes evicts it

📄 ingestion/src/metadata/ingestion/source/dashboard/microstrategy/client.py:301-315 📄 ingestion/src/metadata/ingestion/source/dashboard/microstrategy/client.py:337-342 📄 ingestion/src/metadata/ingestion/source/dashboard/microstrategy/metadata.py:482-485
cube_behind reads _report_cubes with a plain .get, which does not refresh the LRU entry. _report_cubes is also only written inside the fetch of get_cube_sql_details. The _cube_sql entry for a report is kept alive by move_to_end every time that report is read, so a report used by many dossiers stays cached there. Its _report_cubes entry is never refreshed, though, and drops out once 512 other reports have been resolved. From then on, get_cube_sql_details returns the cached SQL without refetching, while cube_behind(R1) falls back to R1. get_dataset_subtype then returns the report's own subtype (768) instead of the Data Import cube's (779/780). That report gets matched as a schema-based cube, and its column lineage on large servers is wrong or empty. A fix: store the resolved source cube with the cached SQL entry, or have cube_behind refresh and backfill the entry (for example, call get_report_cube when it is missing and the dataset is known to be a report).

✅ Edge Case: Report's cube can still be lost when _cube_sql hits after eviction

📄 ingestion/src/metadata/ingestion/source/dashboard/microstrategy/metadata.py:439 📄 ingestion/src/metadata/ingestion/source/dashboard/microstrategy/metadata.py:453 📄 ingestion/src/metadata/ingestion/source/dashboard/microstrategy/client.py:310-319 📄 ingestion/src/metadata/ingestion/source/dashboard/microstrategy/client.py:337-343 📄 ingestion/tests/unit/topology/dashboard/test_microstrategy.py:1478-1489
_parse_cube still asks cube_behind(cube_id) after get_cube_sql_details, and that only works when the report fetch actually ran. Two LRU caches are involved. When _cube_sql already holds the report, cached calls move_to_end on that entry only. _report_cubes[R1] is not refreshed. Here is a sequence that loses the cube: _source_tables drops (R1, dialect), either from churn or because a second dbServicePrefix uses another dialect, so _parse_cube runs again and refreshes R1 in _cube_sql. Meanwhile more than 512 other reports have pushed R1 out of _report_cubes. cube_behind then returns R1, so get_dataset_subtype reads the report's subtype (768) and not the Data Import cube's. The source treats the cube as a schema cube and drops the name-matched column lineage. The new test clears _report_cubes only after the parse, so it never covers this hit path. A fix is to keep the source cube in the same cache entry as the SQL, so one lookup returns both.

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 27614c4 into 2.0 Nov 19, 2026
70 of 74 checks passed
@Khairajani
Khairajani deleted the mstr-cube-report-source-2.0 branch November 19, 2026 12:55
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