dbt-sqlserver version: 1.9.1 (works correctly on 1.9.0)
dbt-core version: 1.11.11
Database: SQL Server 2022
Problem:
When using a custom schema prefix in dbt_project.yml like this:
models:
my_project:
staging:
+schema: stage
raw_vault:
+schema: raw_vault
The generate_schema_name macro correctly produces myproject_stage and myproject_raw_vault as the actual database schemas. But in 1.9.1, the Relation objects passed to get_catalog_relations have relation.schema = 'stage' instead of relation.schema = 'myproject_stage'. The catalog query therefore finds nothing and the catalog is written empty.
Bisect
1.9.0 works. 1.9.1 broke this. The only meaningful change between those releases is the removal of dbt-fabric as an upstream dependency (PR #628). Something in that dependency previously ensured Relation objects were constructed with the fully-generated schema name.
Sources are unaffected — their schema is their actual database schema and requires no prefix, so they resolve correctly.
Workaround
Pin to dbt-sqlserver==1.9.0.
dbt-sqlserver version: 1.9.1 (works correctly on 1.9.0)
dbt-core version: 1.11.11
Database: SQL Server 2022
Problem:
When using a custom schema prefix in dbt_project.yml like this:
Bisect
1.9.0 works. 1.9.1 broke this. The only meaningful change between those releases is the removal of dbt-fabric as an upstream dependency (PR #628). Something in that dependency previously ensured Relation objects were constructed with the fully-generated schema name.
Sources are unaffected — their schema is their actual database schema and requires no prefix, so they resolve correctly.
Workaround
Pin to dbt-sqlserver==1.9.0.