Skip to content

fix: avoid false positive AmbiguousCatalogMatchError for case-only differences#12644

Open
chinar-amrutkar wants to merge 2 commits intodbt-labs:mainfrom
chinar-amrutkar:fix/11776-case-sensitive-catalog-match
Open

fix: avoid false positive AmbiguousCatalogMatchError for case-only differences#12644
chinar-amrutkar wants to merge 2 commits intodbt-labs:mainfrom
chinar-amrutkar:fix/11776-case-sensitive-catalog-match

Conversation

@chinar-amrutkar
Copy link

Resolves #11776

Problem

When a database has tables that differ only by case (e.g., 'Subject' and 'subject'), dbt docs generate incorrectly raises an error because the CatalogKey lowercases both the schema and table name, causing them to collide.

Solution

This fix:

  1. Adds a check to detect case-only differences between existing and new table entries
  2. When such a case-only difference is detected, skip adding the duplicate to avoid false positive errors
  3. Keeps backward compatibility by adding optional case_sensitive parameter to mapping_key and get_unique_id_mapping for future use

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

…fferences

When a database has tables that differ only by case (e.g., 'Subject' and
'subject'), dbt docs generate incorrectly raises an error because the
CatalogKey lowercases both the schema and table name, causing them to
collide.

This fix:
1. Adds a check to detect case-only differences between existing and new
   table entries
2. When such a case-only difference is detected, skip adding the
   duplicate to avoid false positive errors
3. Keeps backward compatibility by adding optional case_sensitive parameter
   to mapping_key and get_unique_id_mapping for future use

Fixes dbt-labs#11776
@chinar-amrutkar chinar-amrutkar requested a review from a team as a code owner March 11, 2026 21:31
@cla-bot
Copy link

cla-bot bot commented Mar 11, 2026

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @chinar-amrutkar

@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@github-actions github-actions bot added the community This PR is from a community member label Mar 11, 2026
@cla-bot cla-bot bot added the cla:yes label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes community This PR is from a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] dbt docs generate fails when two object names in source database differ only by case

1 participant