Compilation Error in incremental model

Hi community,
I am getting this compilation error with the following incremental model using dbt-sqlserver (dbt version 1.4.1).

Error message:
Compilation Error in model Stg_Usz_DRG_Diagnosis_v1 (models\staging\Stg_Usz_DRG_Diagnosis_v1.sql)
macro ‘dbt_macro__sqlserver__get_delete_insert_merge_sql’ takes not more than 4 argument(s)

If I remove the unique_key dbt runs fine. Any suggestions would be much appreciated.

MyModel.sql:

{{
    config(
        materialized='incremental',
        unique_key='Diagnosis_ID'
    )
}}

select * from {{source('EntityView', 'Usz_DRG_Diagnosis') }}

{% if is_incremental() %}

  -- this filter will only be applied on an incremental run
  where LastUpdateDateTime >= (select max(LastUpdateDateTime) from {{ this }})

{% endif %}

I am not sure if this is the problem as I do not use dbt-sqlserver, but try to pass the column inside a list unique_key=['Diagnosis_ID'].

Maybe dbt is interpreting the string as a list of chars

Thanks for your suggestion, unfortunately the same error occurs.

It seems like the get_delete_insert_merge_sql macro in dbt-core is called with five arguments

And the macro in dbt-sqlserver accepts only four

Maybe that is the problem? Can you show the versions of dbt and dbt-sqlserver you are using?

If you are using dbt version 1.4, then I think that is the problem, because dbt-sqlserver latest version is 1.3.

Then I would suggest downgrading dbt version to 1.3 and raising an issue in the dbt-sqlserver

Edit: there is already an issue raised upgrade to support dbt-core v1.4.0 · Issue #333 · dbt-msft/dbt-sqlserver · GitHub

Thanks Bruno, I will test this asap (I am having other proxy issues) but I would find it surprising that installing dbt-sqlserver includes an incompatible dbt-core version.
Best

Confirmed, installing dbt-core==1.3 fixed the compilation error.
Thanks again.

Nice to hear that @Arnau, can you mark the answer as Solution? thanks :smiley:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.