Skip to content

Ingestion filters: no search lookups to decide, exclusions reported once, PowerBI reads only kept items - #39889

Open
Khairajani wants to merge 2 commits into
mainfrom
fix/filter-decisions-reported-once
Open

Khairajani wants to merge 2 commits into
mainfrom
fix/filter-decisions-reported-once

Conversation

@Khairajani

Copy link
Copy Markdown
Contributor

Describe your changes:

Part of open-metadata/openmetadata-collate#8106: the ingestion-side filtering fixes. Test connection follows in a second PR.

  • No search request to decide a filter. View FQNs (common_db_source.py) and NoSQL collection FQNs (common_nosql_source.py) are built with skip_es_search=True, as table FQNs already are. Before, every view and every Mongo/Couchbase/… collection cost one search request before its filter decision.
  • Each exclusion reported once.
    • mark_databases_as_deleted re-listed databases with reporting on, so every excluded database appeared twice in the run's filtered list. It now lists them with add_to_status=False. The seen-set is unchanged, and the comment now says what the code does.
    • CommonNoSQLSource gains a get_raw_database_schema_names that only lists. Before, mark-deleted (on by default) fell back to the filtering, reporting producer, so excluded databases were reported twice.
  • PowerBI non-admin mode reads details only for kept items. Tiles are fetched only for dashboards the dashboard filter keeps, and dataset tables only for data models the data-model filter keeps. Tiles and tables are read only for kept items further down, so the skipped calls were wasted. The workspace still lists every item, so SourceListing counters, filter reports and deletion behaviour are unchanged.
  • Docstrings. Every filter_by_* said "include takes precedence over exclude"; _filter lets exclude win. They now say so.

Not changed on purpose: the PowerBI workspace filter. It is only an OData approximation of the regex (sales becomes contains), so re-checking workspaces locally with re.match would drop workspaces existing pipelines ingest, and mark-deleted would remove their dashboards. That needs its own decision.

Type of change:

  • Bug fix

High-level design:

N/A: small fixes; no new contract or behaviour change in what gets ingested.

Tests:

Which test layer and why

Python unit tests. Each pins a call that must not happen (search request, second report, detail fetch) on mocked clients.

Use cases covered

  • Views (raw-name and FQN filtering) and NoSQL collections are filtered with no search request.
  • Mark-deleted listings for databases and NoSQL schemas report nothing; ingestion still reports each excluded schema once.
  • PowerBI non-admin mode fetches tiles/tables only for kept dashboards and data models, everything without filters, and still lists, counts and reports excluded items.

Unit tests

  • Added tests/unit/topology/database/test_filter_decisions.py and tests/unit/topology/dashboard/test_powerbi_fetch_pruning.py (10 tests).
  • Tests fail first: on main's source 7 of 10 fail on behaviour (search called twice per view/collection, status.filter called again from mark-deleted, tiles/tables fetched for excluded items); the 3 guards pass. All 10 pass on this branch.
  • 6,074 passed across tests/unit/topology/database, tests/unit/topology/dashboard, tests/unit/source/database and the filter-pattern tests.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • tests/integration/mongodb not run locally: pending (merge queue runs it).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

None beyond the tests above.

UI screen recording:

Not applicable: ingestion-only change.

Checklist:

  • I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

🤖 Generated with Claude Code

…ons once, prune PowerBI detail reads

Views and NoSQL collections build their filter FQN without a search request,
as tables already do. Mark-deleted listings no longer report excluded
databases or NoSQL schemas a second time. Non-admin PowerBI reads tiles and
dataset tables only for the dashboards and data models the filters keep. The
filter_by_* docstrings now say exclude wins, which is what _filter does.
@Khairajani
Khairajani requested a review from a team as a code owner December 5, 2026 19:11
@Khairajani
Khairajani requested review from stout-yeoman and removed request for a team December 5, 2026 19:11
@github-actions

github-actions Bot commented Dec 5, 2026

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 Dec 5, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Skipping search lookups for view and collection filters and pruning PowerBI detail reads changes ingestion execution; inconsistent filter decisions could omit metadata.

Stops view and NoSQL collection filtering from issuing search requests, reports each excluded database and schema once instead of twice, and makes PowerBI non-admin mode fetch tiles and dataset tables only for kept dashboards and data models. 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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant