Skip to content

Backport #31958 to 2.0: fix(glue): stop a custom databaseName dropping every schema - #32399

Merged
mohittilala merged 1 commit into
2.0from
backport/31958-to-2.0
Sep 1, 2026
Merged

mohittilala merged 1 commit into
2.0from
backport/31958-to-2.0

Conversation

@mohittilala

Copy link
Copy Markdown
Contributor

Backport of #31958 to 2.0.

Setting the Glue databaseName produced a successful ingestion with zero schemas and zero tables. get_database_schema_names compared that label against the Glue Catalog ID (the AWS account ID), so nothing ever matched, every schema was skipped, and the run still reported Success with no failures and no warnings.

Cherry-picked from 311b17d0f2f. Original issue: open-metadata/openmetadata-collate#5942.
Clean cherry-pick, no conflicts. Identical to main: 15 files, +208/-7.

* fix(glue): stop a custom databaseName dropping every schema

databaseName labels the OpenMetadata database, it does not name a Glue
catalog. Schema discovery compared it against the Glue Catalog ID, so a
custom name matched nothing and every schema was skipped while the run
still reported Success.

Skip that comparison when databaseName is set, since one name means one
database and every visible Glue database is one of its schemas. Warn when
that merges schemas from more than one catalog, so same-named schemas
colliding is visible rather than silent.

Also correct the connection schema description, which claimed the default
database name is "default" while the code uses the Glue Catalog ID.

* Update generated TypeScript types

* fix(glue): read a schema's tables from its own catalog

_get_glue_tables called get_tables with DatabaseName only, so it read from
the caller's default catalog. Now that a schema from another catalog can be
yielded, its tables would come back empty or belong to a same-named database
in the wrong catalog.

Stash each schema's Catalog ID as it is yielded and pass it to get_tables.
The default path is unaffected, since the database there already is the
caller's Catalog ID.

* fix(glue): ignore a missing Catalog ID when counting catalogs

GlueSchema.CatalogId is Optional, and adding it unguarded put None in the
set used for the merge warning. Sorting that set then raised TypeError
outside the per-schema try/except, so one database without a Catalog ID
aborted schema discovery for the whole service.

Track only non-empty Catalog IDs, reusing the guard the catalog map
already applies.

* test(glue): assert on the warning reason, not the dict repr

Status.warnings holds {key: reason} dicts, so asserting against str() of
the entry depended on dict formatting and never checked which database the
warning was about. Index by the database name instead, so a warning keyed
to the wrong entity fails.

* fix(glue): read Iceberg column detail from the schema's own catalog

get_columns fetched Iceberg table detail with DatabaseName only, so for a
schema discovered in another catalog the lookup resolved in the caller's
catalog and raised. The fallback below it then served the unfiltered
storage-descriptor columns, bringing dropped Iceberg columns back as live
ones with only a logged warning.

Pass CatalogId the same way _get_glue_tables does.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@mohittilala
mohittilala requested review from a team as code owners September 1, 2026 17:17
@github-actions

github-actions Bot commented Sep 1, 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.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@mohittilala mohittilala added the skip-pr-checks Bypass PR metadata validation check label Sep 1, 2026
@gitar-bot

gitar-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backport of fix for Glue connector where setting a custom databaseName caused all schemas to be skipped during ingestion. The issue in get_database_schema_names was comparing the label against the AWS account ID instead of the configured database name, resulting in zero schemas ingested despite successful completion. No issues found.

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

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.1% (80535/120006) 51.63% (49400/95675) 52.51% (14726/28043)

@mohittilala
mohittilala enabled auto-merge (squash) September 1, 2026 17:40
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@mohittilala
mohittilala merged commit bf621b1 into 2.0 Sep 1, 2026
124 of 130 checks passed
@mohittilala
mohittilala deleted the backport/31958-to-2.0 branch September 1, 2026 17:42

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 skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants