Skip to content

Conversation

yu-iskw
Copy link
Contributor

@yu-iskw yu-iskw commented Oct 7, 2025

Solves #869

I don't want to wrap string with single quotes. If we print out a JSON object or a YAML object, it is hassle to parse the resulting output.

{% macro test_tojson() %}
    {% set x = tojson({"x": "y", "z": ["a", "b", "c"]}) %}
    {{ print(x) }}
{% endmacro %}
# print out
$ dbtf --quiet run-operation test_tojson
'{"x":"y","z":["a","b","c"]}'
# Parse the output of dbt Core with jq
$ dbt --quiet run-operation test_tojson | jq -r '.'

{
  "x": "y",
  "z": [
    "a",
    "b",
    "c"
  ]
}
# Parse the output of dbt Fusion with jq
$ dbtf --quiet run-operation test_tojson | jq -r '.'

jq: parse error: Invalid numeric literal at line 1, column 2

@cla-bot cla-bot bot added the cla:yes label Oct 7, 2025
Copy link

github-actions bot commented Oct 7, 2025

This repository enforces signed commits. Please sign your commits by following the docs here.

@yu-iskw yu-iskw force-pushed the issue-869 branch 4 times, most recently from cca7708 to 3ea9a37 Compare October 7, 2025 22:35
Copy link

github-actions bot commented Oct 7, 2025

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@yu-iskw yu-iskw force-pushed the issue-869 branch 2 times, most recently from 9a7aab8 to c674f61 Compare October 7, 2025 22:43
@yu-iskw yu-iskw marked this pull request as ready for review October 7, 2025 22:48
@yu-iskw yu-iskw requested a review from a team as a code owner October 7, 2025 22:48
@yu-iskw
Copy link
Contributor Author

yu-iskw commented Oct 7, 2025

@dbeatty10 I am sorry for bothering you, but I appreciate if you look into it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant