Skip to content
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

The json output for ls should include the database representation #2643

Closed
clrcrl opened this issue Jul 23, 2020 · 2 comments
Closed

The json output for ls should include the database representation #2643

clrcrl opened this issue Jul 23, 2020 · 2 comments
Labels
bug Something isn't working stale Issues that have gone stale

Comments

@clrcrl
Copy link
Contributor

clrcrl commented Jul 23, 2020

Steps to reproduce

$ dbt list --resource-type model --output json

Expected behavior

I expected there to be a key like database_representation

Actual behavior

The closest we currently get is alias, and some config detail

{
   "package_name":"jaffle_shop",
   "name":"customers",
   "resource_type":"model",
   "alias":"customers",
   "config":{...},
   "tags":[

   ],
   "depends_on":{...}
}

The output of dbt --version:

installed version: 0.17.1
   latest version: 0.17.1

Up to date!

Plugins:
  - bigquery: 0.17.1
  - snowflake: 0.17.1
  - redshift: 0.17.1
  - postgres: 0.17.1

Additional context

Use case from Slack: listing the database objects that will be affected by a dbt run

Note that the node returned here does not include a key for "database_representation" (or ismilar)

Alternatives

I messed around quickly, and added database, schema, and identifer to the list of ALLOWED_KEYS here, and could got this far:.


$ dbt list --resource-type model --output json | jq '.database + .schema + .alias'

"analyticsdev_ccarrollcustomers"
"analyticsdev_ccarrollorders"
"analyticsdev_ccarrollstg_customers"
"analyticsdev_ccarrollstg_orders"
"analyticsdev_ccarrollstg_payments"

Which is pretty close — is that a better solution? That breaks down if we're going to include quoting in this though

@clrcrl clrcrl added bug Something isn't working triage labels Jul 23, 2020
@beckjake
Copy link
Contributor

beckjake commented Jul 23, 2020

This is interesting, I am having a very similar issue working on #2641 - we'll probably be able to mark this as a "good first issue" once that's done. As dbt is today, this will be kind of annoying to fix.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2021

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that have gone stale
Projects
None yet
Development

No branches or pull requests

3 participants