Skip to content

Commit

Permalink
Respect quoting for ref/source in dbt-py models #6103
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Jan 16, 2023
1 parent aed3936 commit e48ba3c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%- set ref_dict = {} -%}
{%- for _ref in model.refs -%}
{%- set resolved = ref(*_ref) -%}
{%- do ref_dict.update({_ref | join("."): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}
{%- do ref_dict.update({_ref | join("."): resolved | string | replace('"', '\"')}) -%}
{%- endfor -%}

def ref(*args,dbt_load_df_function):
Expand All @@ -18,7 +18,7 @@ def ref(*args,dbt_load_df_function):
{%- set source_dict = {} -%}
{%- for _source in model.sources -%}
{%- set resolved = source(*_source) -%}
{%- do source_dict.update({_source | join("."): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}
{%- do source_dict.update({_source | join("."): resolved | string | replace('"', '\"')}) -%}
{%- endfor -%}

def source(*args, dbt_load_df_function):
Expand Down

0 comments on commit e48ba3c

Please sign in to comment.