Skip to content
Open
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion dbt/include/trino/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,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