action-sqlfluff icon indicating copy to clipboard operation
action-sqlfluff copied to clipboard

Wrong JSON output with tee and dbt templater

Open psg2 opened this issue 3 years ago • 0 comments

When running with the dbt templater the process might add more output lines that aren't actual JSON format and then it will fail trying to run jq here

e.g:

[0m14:02:51  Unable to do partial parsing because config vars, config profile, or config target have changed
[0m14:02:52  Unable to do partial parsing because config vars, config profile, or config target have changed
[{"filepath":  ...

I think one possible solution is to replace tee with --write-output from sqlfluff itself that was added since version 0.10.1, this way the resulting file only contains the final report.

I could try to make a PR to fix this, what do you think?

psg2 avatar Aug 09 '22 14:08 psg2