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

Sources should have access to variables defined in dbt_project.yml #2269

Closed
clrcrl opened this issue Mar 30, 2020 · 2 comments · Fixed by #2357
Closed

Sources should have access to variables defined in dbt_project.yml #2269

clrcrl opened this issue Mar 30, 2020 · 2 comments · Fixed by #2357
Labels
enhancement New feature or request packages Functionality for interacting with installed packages

Comments

@clrcrl
Copy link
Contributor

clrcrl commented Mar 30, 2020

Describe the feature

var functions in a source definition should have access to vars defined in a dbt_project.yml file.

# dbt_project.yml

models:
  vars:
    segment_schema: my_segment_schema
models/segment.yml

version: 2

sources:
  - name: segment
     schema: "{{ var('segment_schema') }}`

Describe alternatives you've considered

This currently works with CLI vars.

We've also considered nesting this under sources: in the dbt_project.yml

# dbt_project.yml

sources:
  vars:
    segment_schema: my_segment_schema

Additional context

Related Loom video

Who will this benefit?

Package authors

@clrcrl clrcrl added enhancement New feature or request triage labels Mar 30, 2020
@drewbanin drewbanin removed the triage label Mar 30, 2020
@drewbanin drewbanin added this to the Octavius Catto milestone Mar 30, 2020
@drewbanin
Copy link
Contributor

Let's definitely go for sources: instead of models:. We've wanted to pull models: apart for a while now, so this is a really good change. I think the next step is going to be moving these config blocks out of dbt_project.yml entirely :)

@drewbanin drewbanin added the packages Functionality for interacting with installed packages label Apr 1, 2020
@drewbanin
Copy link
Contributor

@beckjake let's make sure we:

  • Render every field in schema.yml
  • Make vars package-scoped, and accessible in the schema.yml context

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

Successfully merging a pull request may close this issue.

2 participants