Skip to content

Fix SQL Server schema not qualified during table introspection#1402

Open
olexanderos wants to merge 3 commits into
datacontract:mainfrom
olexanderos:fix/incorrect-sql-server-schema
Open

Fix SQL Server schema not qualified during table introspection#1402
olexanderos wants to merge 3 commits into
datacontract:mainfrom
olexanderos:fix/incorrect-sql-server-schema

Conversation

@olexanderos

Copy link
Copy Markdown

Summary

  • The mssql ibis backend has no schema kwarg at connect time, so an unqualified table lookup fell back to the login's default schema instead of the one configured in server.schema

  • This made datacontract test fail every check with "Could not read model" whenever a SQL Server contract's tables lived outside the login's default schema

  • Extends _table_database() to pass the schema explicitly at read time for the mssql backend, mirroring the existing Oracle workaround

  • Tests pass (uv run pytest)

  • Code formatted (uv run ruff check --fix && uv run ruff format)

  • Docs updated (if relevant)

  • CHANGELOG.md entry added

The mssql ibis backend has no schema kwarg at connect time, so an
unqualified table lookup falls back to the login's default schema
instead of the one configured in server.schema. This made every
check fail with "Could not read model" whenever the contract's
tables lived outside the login's default schema. Pass the schema
explicitly at read time, mirroring the existing Oracle workaround.
Adds unit tests for _table_database() confirming the mssql backend
now qualifies table lookups with server.schema, mirroring the
existing Oracle test file's structure.
Records the fix so datacontract/schema qualification for SQL
Server is reflected in the changelog for the next release.
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.

1 participant