Skip to content

fix: support case-sensitive Fabric Warehouse collations#375

Open
sdebruyn wants to merge 1 commit into
microsoft:mainfrom
sdebruyn:fix/case-sensitive-dwh
Open

fix: support case-sensitive Fabric Warehouse collations#375
sdebruyn wants to merge 1 commit into
microsoft:mainfrom
sdebruyn:fix/case-sensitive-dwh

Conversation

@sdebruyn
Copy link
Copy Markdown
Collaborator

@sdebruyn sdebruyn commented May 19, 2026

Summary

Fixes #373.

FabricAdapter does not override _make_match_kwargs, so dbt-adapters' default runs unchanged and lowercases identifiers whenever quoting.case_sensitive is False (the dbt-core default). On a Fabric Warehouse provisioned with a case-sensitive collation (e.g. SQL_Latin1_General_CP1_CS_AS), dbt then asks Fabric for a relation by its lowercased name and Fabric correctly answers "no such object" — making the adapter unusable on that warehouse.

How

Add a one-method override on FabricAdapter that uses filter_null_values to drop Nones but preserves the original casing of database, schema, and identifier:

def _make_match_kwargs(self, database: str, schema: str, identifier: str) -> Dict[str, str]:
    return filter_null_values(
        {
            "database": database,
            "identifier": identifier,
            "schema": schema,
        }
    )

Behaviour on case-insensitive collations is unchanged: Fabric's identifier comparison ignores case on those collations regardless of what we pass in.

Test plan

  • Unskip TestCachingUppercaseModel (was marked pytest.mark.skip(reason="Fabric DW does not support Case Insensivity.")). It exercises the relation-cache hit path with mixed-case identifiers; with the override in place it now passes against case-sensitive collations and continues to pass against case-insensitive ones.
  • I'm a non-Microsoft contributor and cannot run the CI against the Microsoft Fabric tenant. Happy to add a local test-run screenshot if a maintainer wants to engage with the change.

Closes #373

dbt-adapters' default `_make_match_kwargs` lowercases identifiers when
`quoting.case_sensitive` is False (the dbt-core default). On a Fabric
Warehouse provisioned with a case-sensitive collation (e.g.
SQL_Latin1_General_CP1_CS_AS), dbt then looks up the lowercased name and
Fabric correctly returns no such object, making the adapter unusable
against the warehouse.

Override `_make_match_kwargs` on FabricAdapter to match identifiers
exactly as written, and unskip TestCachingUppercaseModel which now passes.
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.

Case-sensitive Fabric Warehouses broken: _make_match_kwargs not overridden

1 participant