Repository navigation
Fixes #35965: Ingest PowerBI report pages as charts of their report [Backport #35970 - 2.0] - #36062
Conversation
…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)
❌ 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 |
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 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:
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.pyandpowerbi/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 (norcheck_ruff_suppressions.py); main's change to it only pruned the baselined f-string log call this change removes.docs/decisions/2026-10-22-powerbi-report-pages-are-charts-named-by-report-id-and-page-name.mdis kept.Everything the change relies on is already on 2.0:
WorkspaceState(identical to main's before the change),DashboardServiceSource.register_record,register_record_chartandmark_charts_as_deleted, the class-levelchart_source_state,_advance_group_progress, and the topology order that yields a workspace's charts before its dashboards. 2.0 has noyield_dashboard_chart_lineagestage, 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:test_connection.py39,test_powerbi_filter_query.py10,test_powerbi_table_measures.py13,test_dashboard_owned_connection.py5,test_powerbi.py59,test_powerbi_client.py14,test_powerbi_report_pages.py17,test_powerbi_workspace_state.py12,test_powerbi_resilience.py17. 186 passed, 0 failed.client.py,metadata.pyandworkspace_state.pyput back, 22 of the 102 tests in the changed test files fail, so they test this change on 2.0.test_powerbi.pymocks it, sotest_powerbi.pyandtest_powerbi_report_pages.pywere also run together in one process in both orders. Both orders pass.tests/integration/powerbi/, 1 passed.ruff checkandruff format --checkpass with 2.0's config.basedpyright --baselinemode=discardreports 0 errors on the changed files.Self-review:
fe7868b0735was reviewed againstREVIEW.mdwith 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:
🤖 Generated with Claude Code
The page cache must meet the repository’s explicit size-cap requirement before merging.
Findings
Summary
Adds Power BI report pages as charts named with the report ID and page name.
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]Reviews (1) · Last reviewed commit: "Fixes #35965: Ingest PowerBI report page..." · Reviewed by Greptile