Dynamically change snowflake warehouse on variable input

The problem I’m having

I want to dynamically change to snowflake_warehouse based on a variable input. Is there a way to use a variable in the config block of a model to change which snowflake warehouse is used?

Below is what i’ve tried in the config block but I can’t get it to compile correctly.

Some example code or error messages

snowflake_warehouse: var('default_xs_warehouse') if is_incremental() else var('small_warehouse'),

One other version i’ve tried that someone online said worked for them (but it didn’t work for me):

{{
  config({
    "materialized": "incremental", 
    "unique_key": "pk_number", 
    "on_schema_change": "fail",
    "snowflake_warehouse": var('m_warehouse') if is_incremental() else var('xl_warehouse')
  })
}}