Skip to content

Fixes #11571: Preserve custom Glue database names during ingestion - #31820

Closed
ayush-shah wants to merge 1 commit into
mainfrom
ayush-shah/fix-glue-custom-database-name
Closed

ayush-shah wants to merge 1 commit into
mainfrom
ayush-shah/fix-glue-custom-database-name

Conversation

@ayush-shah

@ayush-shah ayush-shah commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Fixes #11571

Summary

A configured Glue databaseName is an OpenMetadata display name, not necessarily the AWS Glue CatalogId. After the catalog filtering change in #26908, schema discovery compared the display name directly with CatalogId and silently skipped every schema when a custom name was configured.

This change keeps catalog filtering for the default Catalog ID-based path and skips that comparison only for the documented custom-name path. It adds a regression test covering schema discovery with a custom database name.

Validation

  • pytest -c ingestion/pyproject.toml ingestion/tests/unit/topology/database/test_glue.py -q — 10 passed
  • ruff check on the changed Python files
  • ruff format --check on the changed Python files
  • git diff --check

Greptile Summary

The PR allows Glue schema discovery to proceed when the configured OpenMetadata database display name differs from AWS Glue's CatalogId and adds regression coverage for that path.

  • Makes CatalogId filtering conditional on databaseName being unset.
  • Adds a unit test for schema discovery with a custom database display name.

Confidence Score: 4/5

The PR should not merge until custom display names preserve AWS Glue catalog scoping when discovery returns databases from multiple catalogs.

The new truthiness check accepts every CatalogId returned by an unscoped get_databases paginator and emits those schemas beneath one display-named OpenMetadata database.

Files Needing Attention: ingestion/src/metadata/ingestion/source/database/glue/metadata.py

Important Files Changed

Filename Overview
ingestion/src/metadata/ingestion/source/database/glue/metadata.py Fixes custom-name discovery but disables catalog scoping, allowing schemas from other returned Glue catalogs into the same OpenMetadata database.
ingestion/tests/unit/topology/database/test_glue.py Adds regression coverage for a custom display name with one catalog, but does not exercise mixed-CatalogId pages.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Glue get_databases pages] --> B{databaseName configured?}
  B -->|No| C[Keep schemas matching current CatalogId]
  B -->|Yes| D[Accept schemas from every returned CatalogId]
  C --> E[Emit OpenMetadata schemas]
  D --> E
Loading

Reviews (1): Last reviewed commit: "Fix Glue custom database schema discover..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used:

@ayush-shah
ayush-shah requested a review from a team as a code owner August 20, 2026 08:45
Copilot AI lite review requested due to automatic review settings August 20, 2026 08:45
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 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 Aug 20, 2026
Comment on lines +191 to +192
# A configured databaseName is an OpenMetadata display name, not a CatalogId.
if not self.service_connection.databaseName and schema.CatalogId != database_name:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Catalog scoping is disabled

If Glue returns databases from multiple CatalogIds, configuring databaseName disables the only CatalogId filter and emits every returned schema beneath one OpenMetadata database, causing unrelated schemas to be ingested together and same-named schemas to collide on one FQN.

Knowledge Base Used: Ingestion Framework

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Glue schema discovery when a custom databaseName is configured by avoiding an incorrect comparison between the OpenMetadata display name and AWS Glue CatalogId, and adds a regression test to cover the custom-name path.

Changes:

  • Adjust schema discovery filtering to skip the CatalogId != database_name check when databaseName is configured.
  • Add a unit test validating get_database_schema_names() behavior with a custom database name.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ingestion/src/metadata/ingestion/source/database/glue/metadata.py Updates catalog filtering logic in schema discovery for the custom databaseName path.
ingestion/tests/unit/topology/database/test_glue.py Adds regression coverage for schema discovery with a custom database name.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +191 to 193
# A configured databaseName is an OpenMetadata display name, not a CatalogId.
if not self.service_connection.databaseName and schema.CatalogId != database_name:
continue
Comment on lines +184 to +194
glue_source_new._get_glue_database_and_schemas = lambda: [
DatabasePage(
DatabaseList=[
GlueSchema(
CatalogId=MOCK_DATABASE.name.root,
Name="default",
Description="current catalog schema",
)
]
)
]
@@ -188,7 +188,8 @@ def get_database_schema_names(self) -> Iterable[str]:
for page in self._get_glue_database_and_schemas() or []:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: Custom databaseName skips all CatalogId scoping in schema discovery

With a custom databaseName configured, the guard now skips the schema.CatalogId != database_name check entirely, so every schema returned by the unscoped get_databases paginator is emitted under the single OpenMetadata database. In the common single-account case this is correct (all databases share one CatalogId), but if discovery ever returns databases from multiple catalogs (e.g. cross-account/shared resources), schemas with identical names from different catalogs would collide under one OM database. Consider scoping the query/filter to the account's own CatalogId even on the custom-name path to keep discovery deterministic. sources: ingestion/src/metadata/ingestion/source/database/glue/metadata.py:191-193

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Preserves custom database display names during Glue schema discovery by making CatalogId filtering conditional. Consider retaining catalog scoping when custom database names are configured to prevent cross-catalog schema pollution.

💡 Edge Case: Custom databaseName skips all CatalogId scoping in schema discovery

📄 ingestion/src/metadata/ingestion/source/database/glue/metadata.py:188-202

With a custom databaseName configured, the guard now skips the schema.CatalogId != database_name check entirely, so every schema returned by the unscoped get_databases paginator is emitted under the single OpenMetadata database. In the common single-account case this is correct (all databases share one CatalogId), but if discovery ever returns databases from multiple catalogs (e.g. cross-account/shared resources), schemas with identical names from different catalogs would collide under one OM database. Consider scoping the query/filter to the account's own CatalogId even on the custom-name path to keep discovery deterministic. sources: ingestion/src/metadata/ingestion/source/database/glue/metadata.py:191-193

🤖 Prompt for agents
Code Review: Preserves custom database display names during Glue schema discovery by making CatalogId filtering conditional. Consider retaining catalog scoping when custom database names are configured to prevent cross-catalog schema pollution.

1. 💡 Edge Case: Custom databaseName skips all CatalogId scoping in schema discovery
   Files: ingestion/src/metadata/ingestion/source/database/glue/metadata.py:188-202

   With a custom `databaseName` configured, the guard now skips the `schema.CatalogId != database_name` check entirely, so every schema returned by the unscoped `get_databases` paginator is emitted under the single OpenMetadata database. In the common single-account case this is correct (all databases share one CatalogId), but if discovery ever returns databases from multiple catalogs (e.g. cross-account/shared resources), schemas with identical names from different catalogs would collide under one OM database. Consider scoping the query/filter to the account's own CatalogId even on the custom-name path to keep discovery deterministic. sources: ingestion/src/metadata/ingestion/source/database/glue/metadata.py:191-193

Options

Display: compact → Showing less information.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit dab1c343c33de55556ea4b5667468bd9ee271fb6 in Playwright run 32350370665, attempt 1.

✅ 110 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 56m 45s

⏱️ Max setup 6m 49s · max shard execution 12m 50s · max shard-job elapsed before upload 21m 27s · reporting 3s

🌐 216.88 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 216.88 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 1.79 per UI scenario (216 boots / 121 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 46 0 0 0 0 0
✅ Shard ingestion-01 29 0 0 0 0 0
✅ Shard ingestion-02 35 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@ayush-shah

Copy link
Copy Markdown
Member Author

Closing this PR per request. The investigation confirms the behavior is an unintended regression: CatalogId filtering was intentional for the default path, but it was incorrectly applied to the documented custom database-name path. No code from this PR was merged.

This branch was previously deployed

1 inactive deployment
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.

Glue: Support Custom Database Name

2 participants