Repository navigation
feat(ingest/powerbi): parse report and page filters from report definitions - #20881
brock-acryl wants to merge 12 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
106f388 to
14ff6b0
Compare
14ff6b0 to
e915217
Compare
e915217 to
3cbcdbc
Compare
3cbcdbc to
5f518ad
Compare
5f518ad to
ac44c32
Compare
ac44c32 to
c542091
Compare
c542091 to
b60f35b
Compare
Review follow-ups for the report/page filter parsing: - A legacy `filters` value that is not a JSON string is recorded as a failed filter instead of raising; a parser crash on one report is a `Report Definition Not Parsed` warning for that report only. - `ReportFilter.fields` lists every model field a filter reads (target first), so a TopN's ordering measure reaches the page's inputFields; `target` is strictly the declared field. A filter with neither a target nor a condition is a parse failure, with the exception recorded. - Rendered conditions are bounded: `In [...]` shows 20 values, conditions are capped at 500 chars, and the `filters` property keeps 50 filters with `filtersTruncated` and a `report_filters_truncated` counter. - `datasetEdges` on a report are emitted in sorted order so the golden file is deterministic. - Structure: `_from_aliases`, `_dict_at`, per-operator renderers behind a dispatch table, `ParsedReportDefinition.page_field_refs`, legacy/PBIR filter helpers, `Constant` keys for the serialized filter and `scope` in `to_dict`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- `report_definitions_failed` counts reports whose definition the parser could not handle (the `Report Definition Not Parsed` path). - A renderer test case covers the 500-character condition cap. - Docs and the `extract_report_field_usage` description note that a filter's rendered condition includes the literal values it compares against, which may be business data. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Regenerate the workspace_apis golden so the filter-targeted input fields carry their model properties, and restore import spacing after the rebase. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
125135b to
6161ea2
Compare
PR SummaryOverview Filters are emitted as JSON The report definition parser gains substantial filter parsing and condition rendering; patch metadata paths explicitly remove stale filter custom properties when a run no longer emits them. New reporter counters and warnings cover parse/truncate failures without failing the whole report. Reviewed by Cursor Bugbot for commit 778abba. Bugbot is set up for automated code reviews on this repo. Configure here. |
Report-level filters apply to every page, so a REST page the report definition does not describe still gets their fields as inputFields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Document that filters come only from a fetched and parsed report definition, the 50-entry, 500-character, 20-value and raw-JSON caps, and add tests for the condition shapes the renderer falls back on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alokr-dhub
left a comment
There was a problem hiding this comment.
Looks good. Verified report- and page-level filter parsing across PBIR and legacy formats, condition rendering and truncation caps (50 filters with filtersTruncated and full filterCount, 500-char rendered conditions, 20 In values, 200-char raw JSON fallback), unmatched-page report-filter field deduplication, and non-fatal warning handling when filters or definitions fail to parse. Filter emission stays gated behind default-off extract_report_field_usage, with the literal-value disclosure documented in both config and source docs.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1611bde. Configure here.
…erties With patch_metadata the dashboardInfo patch only adds custom properties, so filters, filterCount or filtersTruncated that a later run no longer emits stayed on the report. With extract_report_field_usage on, the patch now also removes the filter keys this run does not set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Turn on auto-fix | Re-trigger cubic
GitHub kept a stale merge preview from before 65766d1 and reports a conflict although the base branch is fully contained. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps the test file's import block identical to master's apart from the new DashboardPatchBuilder import, so the stack merges cleanly onto master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary
With
extract_report_field_usage:In ["CA"],>= 1000,Last 30 days,Top 5 by [Total Premium]).filterslist plusfilterCounton the report and its pages; every field a filter reads joins the page'sinputFields.Inlists at 20 values, 50 filters per property withfiltersTruncated). Conditions include the literal values compared against; the docs say so.report_definitions_failed, never a lost report.Stack
Part of a stack built on #20842 (Power BI
metadata_api_mode: workspace_apis). Merge order:#20876 → #20877 → #20878 → #20879 → #20880 → #20881 → #20882 → #20883 → #20884 → #20885.
Review this PR's own diff against its base branch; each layer is self-contained and tested on its own.
Checklist
metadata-ingestion/docs/sources/powerbi/)extract_report_field_usage, default off)🤖 Generated with Claude Code