Skip to content

Commit

Permalink
Merge pull request #358 from calkan-cue/parse_json_fix_bq
Browse files Browse the repository at this point in the history
parse_json({{ field }}, wide_number_mode=>'round') was added for the …
  • Loading branch information
jared-rimmer authored Jun 21, 2023
2 parents 247615d + 8ad9142 commit 7789aca
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion macros/parse_json.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
{%- endmacro %}

{% macro bigquery__parse_json(field) -%}
parse_json({{ field }})
parse_json({{ field }}, wide_number_mode=>'round')
{%- endmacro %}

2 changes: 1 addition & 1 deletion macros/upload_exposures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
'{{ exposure.package_name }}', {# package_name #}
{{ tojson(exposure.depends_on.nodes) }}, {# depends_on_nodes #}
{{ tojson(exposure.tags) }}, {# tags #}
parse_json('{{ tojson(exposure) | replace("\\", "\\\\") | replace("'", "\\'") | replace('"', '\\"') }}', wide_number_mode=>'round') {# all_results #}
parse_json('{{ tojson(exposure) | replace("\\", "\\\\") | replace("'", "\\'") | replace('"', '\\"') }}') {# all_results #}
)
{%- if not loop.last %},{%- endif %}
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_models.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{{ tojson(model.tags) }}, {# tags #}
parse_json('''{{ tojson(model.config.meta) }}'''), {# meta #}
'{{ model.alias }}', {# alias #}
parse_json('{{ tojson(model) | replace("\\", "\\\\") | replace("'","\\'") | replace('"', '\\"') }}', wide_number_mode=>'round') {# all_results #}
parse_json('{{ tojson(model) | replace("\\", "\\\\") | replace("'","\\'") | replace('"', '\\"') }}') {# all_results #}
)
{%- if not loop.last %},{%- endif %}
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_seeds.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
'{{ seed.checksum.checksum }}', {# checksum #}
parse_json('''{{ tojson(seed.config.meta) }}'''), {# meta #}
'{{ seed.alias }}', {# alias #}
parse_json('{{ tojson(seed) | replace("\\", "\\\\") | replace("'","\\'") | replace('"', '\\"') }}', wide_number_mode=>'round') {# all_results #}
parse_json('{{ tojson(seed) | replace("\\", "\\\\") | replace("'","\\'") | replace('"', '\\"') }}') {# all_results #}
)
{%- if not loop.last %},{%- endif %}
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_snapshots.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
'{{ snapshot.config.strategy }}', {# strategy #}
parse_json('''{{ tojson(snapshot.config.meta) }}'''), {# meta #}
'{{ snapshot.alias }}', {# alias #}
parse_json('{{ tojson(snapshot) | replace("\\", "\\\\") | replace("'","\\'") | replace('"', '\\"') }}', wide_number_mode=>'round') {# all_results #}
parse_json('{{ tojson(snapshot) | replace("\\", "\\\\") | replace("'","\\'") | replace('"', '\\"') }}') {# all_results #}
)
{%- if not loop.last %},{%- endif %}
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_sources.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
'{{ source.identifier }}', {# identifier #}
'{{ source.loaded_at_field | replace("'","\\'") }}', {# loaded_at_field #}
parse_json('{{ tojson(source.freshness) | replace("'","\\'") }}'), {# freshness #}
parse_json('{{ tojson(source) | replace("\\", "\\\\") | replace("'", "\\'") | replace('"', '\\"') }}', wide_number_mode=>'round') {# all_results #}
parse_json('{{ tojson(source) | replace("\\", "\\\\") | replace("'", "\\'") | replace('"', '\\"') }}') {# all_results #}
)
{%- if not loop.last %},{%- endif %}
{%- endfor %}
Expand Down

0 comments on commit 7789aca

Please sign in to comment.