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-1902] [Feature] Add relation_name to the node_info dictionary #6724

Closed
3 tasks done
dbeatty10 opened this issue Jan 25, 2023 · 4 comments · Fixed by #7304
Closed
3 tasks done

[CT-1902] [Feature] Add relation_name to the node_info dictionary #6724

dbeatty10 opened this issue Jan 25, 2023 · 4 comments · Fixed by #7304
Labels
enhancement New feature or request logging

Comments

@dbeatty10
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

As described by @jtcohen6 here this feature would:

  • Add relation_name (database.schema.identifier) to the node_info dictionary, which is present on all node-related logging events, and offers a convenience for looking up the most salient information. (The rest can be looked up in the manifest, using the node's unique_id.)

This would provide a mapping from relation_name → node unique_id (or vice versa). Other properties can be looked up via the node's unique_id within manifest.json.

Describe alternatives you've considered

I'm not aware of any reasonable alternatives to determine the final database.schema.identifier for a model that has been built.

For those who love a good unstructured text parsing challenge, I suppose they could try to extract this from logs/dbt.log somehow.

Who will this benefit?

There is at least one issue where a user wants to monitor logs for successful model execution and trigger another process downstream:

Are you interested in contributing this feature?

No response

Anything else?

No response

@dbeatty10 dbeatty10 added enhancement New feature or request triage labels Jan 25, 2023
@github-actions github-actions bot changed the title [Feature] Add relation_name to the node_info dictionary [CT-1902] [Feature] Add relation_name to the node_info dictionary Jan 25, 2023
@jtcohen6
Copy link
Contributor

@isaac-taylor says he'd like this :) and the components, too (database, schema, alias)

@dbeatty10
Copy link
Contributor Author

For refinement:

  • When writing relation_name (and database, schema, identifier components) to the node_info dictionary, do we need to worry about case-sensitivity and/or quoted identifiers?

e.g., would we want to write out quoting also?

I'm guessing a consumer of this info will want to compare relation_name, etc for equality. I'm assuming case-sensitivity, quoting, and database-specific casing of unquoted identifiers would effect those comparisons.

@dbeatty10 dbeatty10 added the Refinement Maintainer input needed label Apr 10, 2023
@jtcohen6
Copy link
Contributor

@dbeatty10 Sorry, I missed your comment before resolving this in #7304!

The approach we're taking right now:

  • database, schema, alias are just the values (no quoting applied)
  • relation_name will be the full string representation, which respects "include" and "quoting" policies

We could add quoting as a standalone property in the future, but I think this strikes a nice balance for now, and matches what's available in the manifest

@jtcohen6 jtcohen6 removed the Refinement Maintainer input needed label Apr 10, 2023
@dbeatty10
Copy link
Contributor Author

No worries!

Agreed that this strikes a nice balance:

relation_name will be the full string representation, which respects "include" and "quoting" policies

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

Successfully merging a pull request may close this issue.

2 participants