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

Expose "project_name" to contexts #1981

Closed
beckjake opened this issue Dec 5, 2019 · 0 comments · Fixed by #2085
Closed

Expose "project_name" to contexts #1981

beckjake opened this issue Dec 5, 2019 · 0 comments · Fixed by #2085
Labels
enhancement New feature or request

Comments

@beckjake
Copy link
Contributor

beckjake commented Dec 5, 2019

Describe the feature

We should expose the project name in dbt contexts (at least during runtime and parsing, which is easy). This is useful, for example, to check if a model is from the currently running project. It also would provide a nice way for users to access macros that might be hard to name: "the current project's macro, if it exists, or my dependency macro if it doesn't" - currently I don't know how to even express that in dbt!

Describe alternatives you've considered

Users can currently access the project name via gross hacks like ref.config.project_name. We should probably remove that access as part of this.
We could also fix macro namespacing to be a bit more accessible to users, but that is a very large task. This feature is much simpler.

Who will this benefit?

Mostly macro developers, I imagine.

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

Successfully merging a pull request may close this issue.

2 participants