-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow dbt show
and dbt compile
to output JSON without extra logs
#9958
base: main
Are you sure you want to change the base?
Conversation
fire_event(compiled_node_event) | ||
else: | ||
# Cleaner to leave as print than to mutate the logger not to print timestamps. | ||
print(compiled_node_event.message()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the new PrintEvent being added to dbt-common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I'll check out dbt-labs/dbt-common#130 and give PrintEvent
a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: see #10131 for an example how to use PrintEvent
.
resolves #9840
Problem
As described in #9840:
dbt list
uses the--quiet
flag to isolate the desired output from the log output, allowing the results to be piped or redirected.But currently,
dbt show
anddbt compile
to not work similarly.Solution
Adopt the same exact approach as
dbt list
here, and basically copy-paste the code it uses.Checklist