Skip to content

unique test on seed fails with "Invalid column name 'None'" in dbt-sqlserver 1.9.0 #638

@marijnsmets

Description

@marijnsmets

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

  1. Define a seed with a unique test on a column
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions