Skip to content

fix(mode): Ingest Mode report query metadata [Backport #32533 - 1.13] - #33147

Merged
harshsoni2024 merged 3 commits into
1.13from
backport-32533-1-13
Sep 11, 2026
Merged

fix(mode): Ingest Mode report query metadata [Backport #32533 - 1.13]#33147
harshsoni2024 merged 3 commits into
1.13from
backport-32533-1-13

Conversation

@harshsoni2024

Copy link
Copy Markdown
Contributor

backport of de358dc on 1.13

* Fixes #22559: Ingest Mode report query metadata

* Address Mode connector review feedback

* Refine Mode pagination loop guard

* Harden Mode connector edge cases
@harshsoni2024
harshsoni2024 requested review from a team as code owners September 10, 2026 14:11
@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.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Sep 10, 2026
Comment thread ingestion/src/metadata/ingestion/source/dashboard/mode/client.py
Comment thread ingestion/src/metadata/ingestion/source/dashboard/mode/client.py Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.64% (61526/96668) 45.06% (33875/75166) 46.97% (10329/21986)

Report pagination terminated on `len(reports) < REPORTS_PAGE_SIZE`, which made
two assumptions about Mode's API that it does not guarantee.

If a page ever holds fewer than 30 records, the first page satisfies the
condition and the rest of the space is dropped with no warning - reproducing
the missing-reports symptom this change set exists to fix. If a space holds an
exact multiple of 30 records and Mode clamps the out-of-range page back to the
last one, the repeated-page guard raised and killed the whole source, dropping
every dashboard of every space.

Pagination now stops once a page carries no report that was not already seen in
that space, which terminates on an empty page, on a clamped repeat, and on an
ignored page parameter, without assuming how many records a full page holds.
Reports are de-duplicated by token, falling back to the record itself when Mode
omits one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Without `__init__.py`, pytest puts the test file's own directory on sys.path
and imports it under its bare basename, so the new Mode test claimed the
top-level module name `test_client` and collection of the pre-existing
`tests/unit/source/database/burstiq/test_client.py` failed with an import file
mismatch. `tests/unit/source/dashboard/qlikcloud` already carries the same
marker for the same reason, and the 1.13 backport dropped the one the change
carries on main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Backport fixes Mode report ingestion by addressing duplicate final page handling that aborted the entire report and removing hardcoded pagination termination logic tied to Mode's page size of 30. No issues found.

✅ 2 resolved
Edge Case: Duplicate final page aborts entire report ingestion

📄 ingestion/src/metadata/ingestion/source/dashboard/mode/client.py:99-109
Many paginated REST APIs clamp an out-of-range page to the last page and re-return it rather than an empty list. If a space's last page has exactly REPORTS_PAGE_SIZE (30) reports, the loop does not break (len(reports) < 30 is false), requests page+1, receives the same page back, and raises RuntimeError. This exception is uncaught in fetch_all_reports and propagates out of get_dashboards_list, failing the whole Mode source and dropping every dashboard from every space. Prefer stopping gracefully (log a warning and break) instead of raising, so a benign duplicate page ends pagination rather than aborting the run.

Edge Case: Pagination termination hardcodes Mode page size of 30

📄 ingestion/src/metadata/ingestion/source/dashboard/mode/client.py:41 📄 ingestion/src/metadata/ingestion/source/dashboard/mode/client.py:106
Termination relies on len(reports) < REPORTS_PAGE_SIZE with REPORTS_PAGE_SIZE = 30. If Mode's actual reports page size is smaller than 30, the first full page (e.g. 25 items) satisfies < 30 and the loop breaks, silently dropping subsequent pages of reports. This heuristic is fragile against server-side page-size changes; consider following the response's pagination/next link (_links.next) when present rather than assuming a fixed size.

Options

Display: compact → Counting what did not apply, without listing it.

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

@sonarqubecloud

Copy link
Copy Markdown

@harshsoni2024
harshsoni2024 enabled auto-merge (squash) September 11, 2026 06:36
@harshsoni2024
harshsoni2024 merged commit e9ba578 into 1.13 Sep 11, 2026
146 of 151 checks passed
@harshsoni2024
harshsoni2024 deleted the backport-32533-1-13 branch September 11, 2026 06:46
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.

3 participants