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

vars defined at the global level in dbt_project.yml v2 don't end up in schema parsing #2472

Closed
5 tasks
beckjake opened this issue May 20, 2020 · 1 comment
Closed
5 tasks
Assignees
Labels
bug Something isn't working

Comments

@beckjake
Copy link
Contributor

Steps to reproduce

(copy+pasted from Claire in slack)

Add a variable to a package, e.g.:

name: 'marketo_source'
version: '1.0.0'
require-dbt-version: '>=0.17.0'
config-version: 2
vars:
    schema: marketo
    database: raw
  1. Call the var in the same package:
version: 2
sources:
  - name: marketo
    schema: "{{ var('schema') }}"
    database: "{{ var('database') }}"
    tables:
      - name: lead
  1. Install the package in another project, and dbt compile

  2. Get this error:

Compilation Error
  Required var 'database' not found in config:
  Vars supplied to <Configuration> = {}
  1. Move the vars to be package scoped:
name: 'marketo_source'
version: '1.0.0'
require-dbt-version: '>=0.17.0'
config-version: 2
vars:
  marketo_source:
    schema: marketo
    database: raw
  1. Try again, everything works.

Expected behavior:

The var should be resolved in both instances. Vars available in the global scope should behave as if they were in package scope unless overridden by package scope.

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

dbt 0.17.0rc1

Any OS, any Python, any database

@beckjake beckjake added bug Something isn't working triage and removed triage labels May 20, 2020
@beckjake beckjake self-assigned this May 20, 2020
@drewbanin
Copy link
Contributor

closed by #2477

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

No branches or pull requests

2 participants