Repository navigation
Fixes #28467: Resolve Databricks service principal owners - #28466
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves owner resolution for Databricks and Unity Catalog ingestion by resolving workspace service principals and groups (via SCIM) to stable display names before performing OpenMetadata owner lookup.
Changes:
- Added a shared
DatabricksOwnerResolverwith bounded LRU caches to map service principal application IDs and group IDs/names to display names, then resolve to OM owners. - Extended
DatabricksClientwith SCIM pagination helpers and exposed SCIM endpoint paths. - Wired the resolver into both Databricks and Unity Catalog sources, and added unit tests covering SCIM pagination + resolver behaviors.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ingestion/tests/unit/topology/database/test_databricks_ownership.py | Adds unit tests for SCIM pagination and owner resolution behavior for service principals, groups, emails, and fallbacks. |
| ingestion/src/metadata/ingestion/source/database/unitycatalog/metadata.py | Uses the shared DatabricksOwnerResolver for Unity Catalog owner resolution. |
| ingestion/src/metadata/ingestion/source/database/databricks/ownership.py | Introduces the shared resolver and caching/identity-map loading logic. |
| ingestion/src/metadata/ingestion/source/database/databricks/metadata.py | Wires the resolver into Databricks source owner resolution. |
| ingestion/src/metadata/ingestion/source/database/databricks/client.py | Adds SCIM listing (with pagination), SCIM path constants, and broadens auth handling for Databricks/UC connections. |
🟡 Playwright Results — all passed (11 flaky)✅ 4269 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 88 skipped
🟡 11 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
… guard - Guard SCIM pagination against non-positive itemsPerPage values - Replace bulk identity-map loading with per-owner filtered SCIM lookups - Verify SCIM results match the requested owner and escape filter values Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
# Conflicts: # ingestion/src/metadata/ingestion/source/database/unitycatalog/metadata.py
|
The merge with main restored main's version of the test which only patches get_connection; the owner resolver now constructs a DatabricksClient in __init__, so the test must patch it too. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Code Review ✅ Approved 4 resolved / 4 findingsImplements a Databricks and Unity Catalog owner resolver with bounded LRU caching to correctly map service principals and groups. Resolved issues regarding stale OAuth tokens, unsafe Pydantic API usage, and inefficient SCIM lookups. ✅ 4 resolved✅ Quality: Fragile
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Gitar
…er resolution as on main - The stale-database cleanup now lists the catalogs before it checks for a failed listing. With a configured catalog that listing is the run's only catalog listing, and a failure there used to soft-delete every Database it did not return. - Restore the Databricks owner resolver and its tests to main. Its email local-part fallback was added on purpose in #28466; changing it is out of scope here. - Keep the base "No Database found in the context" guard in the table cleanup, and annotate the mark_schemas/mark_databases overrides. - Test the full-mode table cleanup by the scopes it sends, and make the failed table page test fail on main. - Prune the two G004 baseline entries for the logger calls this branch removed.



Describe your changes:
Fixes #28467
I worked on Databricks and Unity Catalog owner resolution so service-principal application IDs and workspace groups can resolve to display names before OpenMetadata owner lookup.
Type of change:
High-level design:
Added a shared Databricks owner resolver backed by bounded LRU caches, SCIM pagination helpers on the Databricks client, and connector wiring for both Databricks and Unity Catalog metadata extraction.
Tests:
Use cases covered
Unit tests
ingestion/tests/unit/topology/database/test_databricks_ownership.pyBackend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
make py_formatandmake py_format_checkfromingestion/.PYTHONPATH=ingestion/src python -m pytest ingestion/tests/unit/topology/database/test_databricks_ownership.py ingestion/tests/unit/topology/database/test_unity_catalog.py ingestion/tests/unit/topology/database/test_databricks_query_reduction.py -q.e20b14dc-a28d-4e62-9caf-b28e88c2461eresolves to service principal display nametest_collate_om, then cleaned up the scratch schema.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.