-
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
[Feature] Allow dbt show
to output json data without extra logs (by updating --quiet
)
#9840
Comments
For posterity, I got this function working with zsh but it looks quite convoluted.
With this function, we can do |
I think I buy what you're suggesting as the behavior of Questions:
|
To me, the answer to both questions is Yes |
Agreed! 🚀 I've run into this same thing before (as recently as this past week), and the proposed behavior would make the output MUCH more ergonomic to work with. |
Show meLet's assume a model named
{%- set noun = "money" -%}
{%- set noun = "JSON" -%}
select 'Show me the {{ noun }}!' as jerry_maguire Examples for
|
Avoiding regressionsWe'd just want to make sure that For
|
I think we can separate these into two different issues, both of which we're interested in (in priority order):
The 2nd one needs more refinement, and I'll create a separate issue for it. Proposed acceptance criteria (for the 1st item above)Main scenarioWhen:
Then:
Additional scenariosWhen:
Then:
When:
Then:
|
dbt show
to output json data without extra logs (maybe just fix/update --quiet
?) dbt show
to output json data without extra logs (by updating --quiet
)
For the 2nd item above, created #9843 and labeled it for further refinement. |
This is really hard to accomplish via I think we can do this by making sure some show result itself gets to stdout when I have some PR that's adding a PrintEvent that always going to get to stdout even when |
@ChenyuLInx Thanks for that info 🧠 I'll try using the approach used in #10131 within my proposed solution in #9958. |
Is this your first time submitting a feature request?
Describe the feature
I would like the output of
dbt show
to be valid JSON, containing just the data and no logs.Some potential solutions:
dbt show
could change its behaviour for--quiet
, printing the results.dbt show
that performs this behaviour if we don't want to change the--quiet
behaviourWhat I want to achieve is to pipe a
dbt show ... --output json
intojq
orjless
. Todaydbt --quiet show ...
doesn't print anything to stdout, which feels counterintuitive (is it a bug actually?)Describe alternatives you've considered
As suggested in the Community Slack I tried
dbt --log-format json show ... --output=json
; but while the data is valid JSON, it doesn't show the results in a nice way as the real data results are encoded in a single string with escaped characters.Who will this benefit?
People using the CLI and wanting a better/usable way to explorer the results of
dbt show
.Are you interested in contributing this feature?
Yes
Anything else?
No response
The text was updated successfully, but these errors were encountered: