# Error with dbt\_utils.generate\_surrogate\_key

**URL:** <https://discourse.getdbt.com/t/error-with-dbt-utils-generate-surrogate-key/12026>\
**Category:** Help\
**Created:** [February 13, 2024, 11:42am UTC](https://discourse.getdbt.com/t/error-with-dbt-utils-generate-surrogate-key/12026 "2024-02-13T11:42:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yokanisha](https://avatars.discourse-cdn.com/v4/letter/y/8c91f0/32.png) [@Yokanisha](https://discourse.getdbt.com/u/Yokanisha)\
**Post date:** [February 13, 2024, 11:42am UTC](https://discourse.getdbt.com/t/error-with-dbt-utils-generate-surrogate-key/12026/1 "2024-02-13T11:42:16Z")

</div>

## Invoke dbt source freshness

 ![01](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/2X/e/eb0fc3596e87c6f5079f4d72936b0da9ca4ede64.png)

By running **build+model (up/downstream)** it works perfectly fine.  
But it appears a error in my deployment.

The error of **Invoke dbt source freshness** says:

```auto
------------------------------------------------------------
  Invoke dbt Command
------------------------------------------------------------
dbt source freshness
11:17:51 Running with dbt=1.7.7
11:17:53 Registered adapter: bigquery=1.7.4
11:17:53 Unable to do partial parsing because saved manifest not found. Starting full parse.
11:17:54 Encountered an error:
Compilation Error in model stg_yellow_tripdata (models/staging/stg_yellow_tripdata.sql)
  
  Warning: `dbt_utils.surrogate_key` has been replaced by `dbt_utils.generate_surrogate_key`. The new macro treats null values differently to empty strings. To restore the behaviour of the original macro, add a global variable in dbt_project.yml called `surrogate_key_treat_nulls_as_empty_strings` to your dbt_project.yml file with a value of True. The taxi_rides_ny.stg_yellow_tripdata model triggered this warning. 
  
  > in macro default__surrogate_key (macros/sql/surrogate_key.sql)
  > called by macro surrogate_key (macros/sql/surrogate_key.sql)
  > called by model stg_yellow_tripdata (models/staging/stg_yellow_tripdata.sql)

```

So I did what the error says and put in my **dbt\_project.ym** this:

```auto
vars:
  surrogate_key_treat_nulls_as_empty_strings: True
  payment_type_values: [1, 2, 3, 4, 5, 6]

```

Also in my **stg\_yellow\_tripdata.sql**

````auto
select
    -- identifiers
    {{ dbt_utils.generate_surrogate_key(["vendorid", "tpep_pickup_datetime"]) }}
    as tripid,
...
```

Does someone know what it could be? I have no idea anymore.
````

---

<div class="post-metadata">

**Author:** ![Yokanisha](https://avatars.discourse-cdn.com/v4/letter/y/8c91f0/32.png) [@Yokanisha](https://discourse.getdbt.com/u/Yokanisha)\
**Post date:** [February 13, 2024, 2:05pm UTC](https://discourse.getdbt.com/t/error-with-dbt-utils-generate-surrogate-key/12026/2 "2024-02-13T14:05:37Z")

</div>

I had done my things but I could resolve it.  
I just delete my branch and created a new repository from my github.  
It works now.
