Skip to content

dbt-utils generate_surrogate_key macro fails for versions 1.4+ when only one field is supplied  #251

@amychen1776

Description

@amychen1776

When an user uses the macro with only one field supplied on the adapter versions 1.4 and above, it fails with the error message "The concat function requires 2 to 254 arguments". This works on dbt 1.3 and fails after 1.4. I suspect it's related to the migration in 1.4 from depending on the dbt-sqlserver adapter to dbt-fabric.

What I expect to happen is when a user has set surrogate_key_treat_nulls_as_empty_strings to true, the adapter will respect that.

https://github.com/dbt-labs/dbt-utils/blob/1.2.0/macros/sql/generate_surrogate_key.sql

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions