custom Incremental strategies

The problem I’m having

I’ve created a macro to have a custom Incremental Merge and call it get_incremental_merge_conditional_sql

Then call this Macro in my models by this config setting:

 unique_key = ['order_id','status'],
 predicates = ['DBT_INTERNAL_SOURCE.status_datetime_nzt > DBT_INTERNAL_DEST.status_datetime_nzt'],
 update_date_column = ['status_datetime_nzt'],

When I run my model return this error:

Invalid incremental strategy provided: merge_conditional
      Expected one of: 'merge', 'replace_where', 'append', 'insert_overwrite'

looks Models can not find this new Macro…
I’ve used this document to create a new Incremental macro:

Do I need to do more settings, please help


The context of why I’m trying to do this

What I’ve already tried

Some example code or error messages

Put code inside backticks
  to preserve indentation
    which is especially important 
      for Python and YAML! 

I’m also encountering this issue on dbt 1.7 and the bigquery adapter. Did you ever find a solution? I’m putting my custom incremental strategy in ./macros and I have many other macros that successfully run from that directory.

it would honestly seem custom incremental strategies are not supported for the BigQuery adapter! You’ll notice that in Snowflake, for example, they use an adapter method to get your strategy macro, but in BigQuery they do no such thing. This macro throws an error unless you supply it with insert_overwrite or merge. I suggest just creating your own materialization and just copying/using the current incremental materialization as a starting point.