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

[CT-424] Dbt list json output should include the final target name of the model #4955

Closed
1 task done
whisperstream opened this issue Mar 25, 2022 · 3 comments
Closed
1 task done
Labels
enhancement New feature or request stale Issues that have gone stale

Comments

@whisperstream
Copy link

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

I execute dbt list -m my_model --output-json > some.json, file some.json should ideally contain the fully qualified target name of the model. In my dbt project I make heavy use of of the generate..x..name() set of schemas to alter the final target name based on the environment.

I depend on the output from dbt list in my CICD processes and recently discovered that it doesn't capture this information in the output - which I feel it should.

Describe alternatives you've considered

I'm working around it right now, by also having to read in the manifiest and parsing that.

Who will this benefit?

Everyone - having the final target (a critical value) as processed by macros would be valuable to a wide audience.

Are you interested in contributing this feature?

Not at this time

Anything else?

No response

@whisperstream whisperstream added enhancement New feature or request triage labels Mar 25, 2022
@github-actions github-actions bot changed the title Dbt list json output should include the final target name of the model [CT-424] Dbt list json output should include the final target name of the model Mar 25, 2022
@jtcohen6
Copy link
Contributor

Thanks for opening @whisperstream! I remember this being open as an issue some time ago: #2643

Since #2837, we do add the fully qualified relation_name for all "relational" nodes (ones that point to / create database objects)—but only at compile time, after loading the adapter:

def _get_relation_name(self, node: ParsedNode):
relation_name = None
if node.is_relational and not node.is_ephemeral_model:
adapter = get_adapter(self.config)
relation_cls = adapter.Relation
relation_name = str(relation_cls.create_from(self.config, node))
return relation_name

compiled_node.relation_name = self._get_relation_name(node)

Why? Because we need to know the adapter's specific rules for creating relation names. Some adapters are schema.table only, some use `` instead of "" as their quote characters, etc.

In order to include this in the output of dbt ls, the information has to be available at the end of parsing, without requiring the additional compilation step (i.e. dbt compile). Is that possible? Someone from the Core - Language team would have to weigh in

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale Issues that have gone stale label Sep 22, 2022
@github-actions
Copy link
Contributor

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Issues that have gone stale
Projects
None yet
Development

No branches or pull requests

2 participants