Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20250828-192402.yaml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion dbt/include/trino/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
{%- endmacro -%}

{% macro comment(comment) %}
{%- set persist_docs = model['config'].get('persist_docs') -%}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind the implementation, but that's the idea. model['config'] can return null.

The code should be updated to make it safer.

{%- 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 -%}
Expand Down