-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add escape_single_quotes macro (#573)
* add escape_single_quotes macro * added changelog entry * Trim trailing whitespace * Trim trailing whitespace Co-authored-by: Doug Beatty <doug.beatty@dbtlabs.com>
- Loading branch information
1 parent
d9a3d76
commit 28a9d09
Showing
3 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: Fixes | ||
body: Added escape_single_quotes macro as Spark/Databricks uses a single backslash | ||
instead of a single quote | ||
time: 2022-12-21T09:24:10.952042-06:00 | ||
custom: | ||
Author: graciegoheen | ||
Issue: "572" | ||
PR: "573" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{# /* Spark/Databricks uses a single backslash: they're -> they\'re. The second backslash is to escape it from Jinja */ #} | ||
{% macro spark__escape_single_quotes(expression) -%} | ||
{{ expression | replace("'","\\'") }} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters