Skip to content

Fixes #35965: Ingest PowerBI report pages as charts of their report [Backport #35970 - 2.0] - #36062

Merged
harshsoni2024 merged 1 commit into
2.0from
backport-35970-2.0
Oct 23, 2026
Merged

harshsoni2024 merged 1 commit into
2.0from
backport-35970-2.0

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #35970 (7ac4c14) to 2.0. Fixes #35965 on 2.0.

PowerBI dashboards carried their tiles as charts, but reports (dashboardType: Report) had none. Each page of a report is now ingested as a chart under its report, named {report_id}_{page.name}, and the report URL is built from the same pages response, so ingestion makes no extra API call. A failed pages read keeps the charts the report already has. When those cannot be read either, the report is left as stored and the run skips the stale-chart pass. For the design, see #35970 and the ADR it adds.

Differences from the main commit

  • powerbi/client.py and powerbi/metadata.py: each conflicted on one line the change removes, where 2.0 still has the older type hints (Optional[List[...]] # noqa: UP006, UP045). Both resolve to main's side, so every line the backport adds is identical to main's.
  • ingestion/.ruff-g004-baseline.json: dropped. 2.0 has no G004 baseline (nor check_ruff_suppressions.py); main's change to it only pruned the baselined f-string log call this change removes.
  • ADR: docs/decisions/2026-10-22-powerbi-report-pages-are-charts-named-by-report-id-and-page-name.md is kept.
  • The other files apply cleanly and are identical to main's.

Everything the change relies on is already on 2.0: WorkspaceState (identical to main's before the change), DashboardServiceSource.register_record, register_record_chart and mark_charts_as_deleted, the class-level chart_source_state, _advance_group_progress, and the topology order that yields a workspace's charts before its dashboards. 2.0 has no yield_dashboard_chart_lineage stage, so on 2.0 page charts, like tiles, are listed under their report without Dashboard→Chart lineage edges, and the note in #35970 about those edges does not apply.

Tests

Run locally on this branch, with 2.0's own generated models and PYTHONPATH=ingestion/src:

  • Unit tests covering the changed files: test_connection.py 39, test_powerbi_filter_query.py 10, test_powerbi_table_measures.py 13, test_dashboard_owned_connection.py 5, test_powerbi.py 59, test_powerbi_client.py 14, test_powerbi_report_pages.py 17, test_powerbi_workspace_state.py 12, test_powerbi_resilience.py 17. 186 passed, 0 failed.
  • With 2.0's original client.py, metadata.py and workspace_state.py put back, 22 of the 102 tests in the changed test files fail, so they test this change on 2.0.
  • 2.0 shares one topology context across dashboard sources, and test_powerbi.py mocks it, so test_powerbi.py and test_powerbi_report_pages.py were also run together in one process in both orders. Both orders pass.
  • Integration: tests/integration/powerbi/, 1 passed.
  • ruff check and ruff format --check pass with 2.0's config. basedpyright --baselinemode=discard reports 0 errors on the changed files.
  • The live Power BI tenant run was done for Fixes #35965: Ingest PowerBI report pages as charts of their report #35970 on main and is not repeated here.

Self-review: fe7868b0735 was reviewed against REVIEW.md with fresh context, focused on what can differ on 2.0 (the dashboard base class and topology, WorkspaceState, the PowerBI models, fqn, the test fixtures and patch targets). No findings.

Type of change:

  • New feature

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The page cache must meet the repository’s explicit size-cap requirement before merging.

Findings

  1. P2 Page cache has no limit ▶

Summary

Adds Power BI report pages as charts named with the report ID and page name.

  • PowerBI report pages now appear as charts under their report.
  • Failed report-page reads now preserve known charts during ingestion.

Intentional behavior acknowledged by harshsoni2024: when neither pages nor stored charts can be read, the report stays unchanged and the run skips stale-chart deletion. The review does not flag that tradeoff.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read report pages once] --> B{Read succeeded?}
  B -->|Yes| C[Create page charts]
  C --> D[Attach charts and build report URL]
  B -->|No| E[Read stored chart links]
  E --> F{Stored links readable?}
  F -->|Yes| G[Keep stored links and charts]
  F -->|No| H[Leave report unchanged]
  H --> I[Skip stale-chart deletion]
Loading

Reviews (1) · Last reviewed commit: "Fixes #35965: Ingest PowerBI report page..." · Reviewed by Greptile

…35970)

* feat(powerbi): ingest report pages as charts of their report

PowerBI dashboards carried their tiles as charts, but reports had none.
Each page of a report now becomes a chart under its PowerBIReport
dashboard, named `{report_id}_{page.name}`: page names such as
`ReportSection` repeat across reports, so the report id keeps chart
FQNs unique within the service.

The Get Pages In Group response is fetched once per report and memoised
in WorkspaceState for the workspace, so the chart stage and the report
url share one call. `_get_report_url` becomes a pure builder that takes
the page to open on, and tiles and pages share one chart helper.

`fetch_report_pages` now always returns a list (a null page list used
to come back as None) and logs at debug when the API returns no pages.

* fix(powerbi): keep a report's page charts when its pages cannot be read

A failed Get Pages In Group read answered the same empty list as a
report without pages, so a transient error soft-deleted the report's
page charts under markDeletedCharts and emptied its chart list, only
for the next good run to restore them.

fetch_report_pages now answers None when the read fails and [] only
for a response with no pages. WorkspaceState memoises a failed read as
well, and for such a report the chart stage keeps the charts the server
already lists under it in the run's live set and in the report.

Also records the page-chart naming in a decision record, adds tests for
the chart error path (on main an untitled tile that failed raised from
the error handler and aborted the chart stage), and drops a filter in
_get_chart_fqns that could never remove a chart.

* fix(powerbi): leave a report as stored when its charts cannot be read

When a report's pages could not be read and the server could not list
its stored charts either, the report was still sent with no charts and
its charts were left out of the run's live set, so the run emptied the
report and markDeletedCharts soft-deleted the charts; with pages that
fail every run, later runs then found nothing left to keep.

Such a report's charts are now unknown: the report is registered but
not sent, so the server keeps its chart links, and the stale-chart pass
is skipped for the run, since a failed discovery must not drive
deletion. The failure is still reported for the report.

* test(powerbi): assert the next report is still sent after an unknown one

The double-failure test dropped the dashboards it ingested, so turning
the unknown-report `continue` into a `return` passed every test while
leaving every later report in the workspace unsent and unregistered.

(cherry picked from commit 7ac4c14)
@harshsoni2024
harshsoni2024 requested a review from a team as a code owner October 23, 2026 06:05
@harshsoni2024 harshsoni2024 added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 23, 2026
@harshsoni2024
harshsoni2024 requested review from mohittilala and removed request for a team October 23, 2026 06: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.

@gitar-bot

gitar-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · PowerBI report-page ingestion adds chart entities and report links; incorrect page discovery could misstate catalog contents or soft-delete existing charts.

Backports PowerBI report page ingestion to 2.0: each report page is now ingested as a chart under its report, named {report_id}_{page.name}, with the report URL built from the same pages response so no extra API call is needed. 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

@sonarqubecloud

Copy link
Copy Markdown

@harshsoni2024
harshsoni2024 merged commit 81392ae into 2.0 Oct 23, 2026
91 of 107 checks passed
@harshsoni2024
harshsoni2024 deleted the backport-35970-2.0 branch October 23, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

2 participants