Running a unique test on a seed table fails with the following error:
('42S22', "[42S22] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'None'.")
Steps to reproduce
- Define a seed with a
unique test on a column
- Run 'dbt test --select <test_name>'
Root cause
The debug logs show that dbt generates the following clause:
offset 0 rows fetch first None rows only
The limit value is None instead of an integer.
Workaround
Adding an explicit limit in the test config resolves the issue:
yaml
tests:
- unique:
config:
limit: 1000
Environment
- dbt-core: 1.9.10
- dbt-sqlserver: 1.9.0
- SQL Server: Microsoft SQL Azure (RTM) - 12.0.2000.8
- OS: Windows Server
- ODBC Driver: 17
Running a
uniquetest on a seed table fails with the following error:('42S22', "[42S22] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'None'.")Steps to reproduce
uniquetest on a columnRoot cause
The debug logs show that dbt generates the following clause:
offset 0 rows fetch first None rows onlyThe
limitvalue isNoneinstead of an integer.Workaround
Adding an explicit
limitin the test config resolves the issue:yaml
Environment