dbt_utils.surrogate_key — Syntax error

vigneshwaransundaresan@Vigneshwarans-MacBook-Pro my-first-dbt-project % dbt run --m example.insert_sample
Running with dbt=0.17.0

  • Deprecation Warning: dbt v0.17.0 introduces a new config format for the
    dbt_project.yml file. Support for the existing version 1 format will be removed
    in a future release of dbt. The following packages are currently configured with
    config version 1:

  • dbt_utils

For upgrading instructions, consult the documentation:


Found 7 models, 15 tests, 1 snapshot, 0 analyses, 208 macros, 1 operation, 0 seed files, 1 source

12:49:26 |
12:49:26 | Running 1 on-run-start hook
12:49:26 | 1 of 1 START hook: dbt_from_scratch.on-run-start.0… [RUN]
12:49:26 | 1 of 1 OK hook: dbt_from_scratch.on-run-start.0… [SUCCESS 1 in 0.16s]
12:49:26 |
12:49:26 | Concurrency: 1 threads (target=‘dev’)
12:49:26 |
12:49:26 | 1 of 1 START incremental model DBT.TYPE1_TESTING… [RUN]
12:49:28 | 1 of 1 ERROR creating incremental model DBT.TYPE1_TESTING… [ERROR in 1.97s]
12:49:29 |
12:49:29 | Finished running 1 incremental model, 1 hook in 5.14s.

Completed with 1 error and 0 warnings:

Database Error in model insert_sample (models/example/insert_sample.sql)
001003 (42000): SQL compilation error:
syntax error line 4 at position 4 unexpected ‘md5’.
syntax error line 11 at position 1 unexpected ‘,’.
compiled SQL at target/compiled/dbt_from_scratch/models/example/insert_sample.sql

Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1

Steps To Reproduce

packages.yml file:

packages:

  • package: fishtown-analytics/dbt-utils
    version: 0.1.18

Expected behavior

Model:

{{ dbt_utils.surrogate_key([‘C_CUSTKEY’,‘AS_OF_DT’]) }} as natural_key

{{
config(
materialized=‘incremental’,
incremental_strategy=‘delete+insert’,
alias=‘TYPE1_TESTING’,
unique_key=‘natural_key’
)
}}

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

Snowflake

The output of dbt --version :

vigneshwaransundaresan@Vigneshwarans-MacBook-Pro my-first-dbt-project % dbt --version
installed version: 0.17.0
latest version: 0.17.0

Up to date!

Plugins:

  • bigquery: 0.17.0
  • snowflake: 0.17.0
  • redshift: 0.17.0
  • postgres: 0.17.0

The operating system you’re using:

macOS

The output of python --version :

Additional context

Add any other context about the problem here

Hi, please open this as an issue on the utils repo

This issue is resolved and no need to post this as an issue and correct usage is below:

{% set natural_key = dbt_utils.surrogate_key(‘C_CUSTKEY’,‘AS_OF_DT’) %}

{{
config(
materialized=‘incremental’,
incremental_strategy=‘delete+insert’,
alias=‘TYPE1_TESTING’,
unique_key=natural_key
)
}}