diff --git a/.changes/unreleased/Fixes-20250828-192402.yaml b/.changes/unreleased/Fixes-20250828-192402.yaml new file mode 100644 index 00000000..ca89f3cc --- /dev/null +++ b/.changes/unreleased/Fixes-20250828-192402.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: Handle when model['config'] is null +time: 2025-08-28T19:24:02.928502+01:00 +custom: + Author: mattiamatrix + Issue: "" + PR: "499" diff --git a/dbt/include/trino/macros/adapters.sql b/dbt/include/trino/macros/adapters.sql index cc680be5..a6eaac6b 100644 --- a/dbt/include/trino/macros/adapters.sql +++ b/dbt/include/trino/macros/adapters.sql @@ -161,7 +161,7 @@ {%- endmacro -%} {% macro comment(comment) %} - {%- set persist_docs = model['config'].get('persist_docs') -%} + {%- set persist_docs = model.get('config', {}).get('persist_docs') -%} {%- if persist_docs -%} {%- set persist_relation = persist_docs.get('relation') -%} {%- if persist_relation and comment is not none and comment|length > 0 -%}