-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CT-2935] [Regression] DBT stdout behavior regression in a 1.5 minor version, breaks some compatibility in SQLFluff #8317
Comments
This is great info -- thanks for the effort of putting it all together @ttusing 🤩 ! The outcome of sqlfluff/sqlfluff-github-actions#15 (comment) was being able to suppress non-error logs in output via I'm wondering if sqlfluff isn't using I like #7994 😎 , but we'll need to learn more from the sqlfluff folks what they need here. |
@dbeatty10 I added an issue to When is Searching around for potentially related issues, also found this |
Personally, I use it most often with dbt --quiet list --output json | jq .
Thanks for opening sqlfluff/sqlfluff#5054 @ttusing! I've subscribed to that issue so I'll be notified of replies. Since this looks like an issue that sqlfluff should be able to handle via |
For anyone watching this issue, sqlfluff merged a PR intended to address this: sqlfluff/sqlfluff#5070 |
Is this a regression in a recent version of dbt-core?
Current Behavior
This issue is somewhat related to observations here in an old
sqlfluff-github-actions
issue: sqlfluff/sqlfluff-github-actions#15 (comment) . This is probably of primary concern to users of Github actions running SQLfluff on their DBT models.I think this could also be considered a bug in SQLfluff.
(and perhaps this feature request: #7994 )
When running SQLFluff with the
dbt
templater, SQLFluff invokes DBT. The common command (described in most of these workflows in some form https://github.com/sqlfluff/sqlfluff-github-actions/tree/main) being run in Github actions is :sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json
The problem is that, if DBT is giving some log output to stdout, this gets injected into the output file and corrupts the JSON output.
This did not happen in dbt
1.5.0
as long as you had generated a manifest to prevent partial parsing in a previous workflow step. One of the DBT minor versions(1.5.2
?) and/or adbt-snowflake
minor version added the adapter version to the output. I.e. this:21:59:43 Registered adapter: snowflake=1.5.2
ends up in the JSON output.
Therefore, using current minor versions of DBT in
1.5
and/or adapters breaks this workflow.I'm not quite savvy enough with logging to say exactly how or why this is happening or strictly what reasonable expected behavior is. It seems like one of these could be true/helpful in preventing this compatibility problem:
grep
that a Github workflow could use to clean up the logs to keep that practice working with newer DBT versions-- quiet
somewhere fix this?dbt
instead ofdefault_stdout
(not sure exactly what this means)I may also open a ticket in SQLFluff and/or SQLFluff Github actions...
Expected/Previous Behavior
DBT does not add log output to SQLFluff when invoked for JSON output.
Steps To Reproduce
1.5.4
Relevant log output
^^ this is the JSON output with bad DBT logs at the top. Adding a
dbt ls
step removed the full parse part, adapter part does not seem able to be worked around, except maybe withgrep
.Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: