-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Bug] References to vars in dbt_project.yml don't work in source yamls #4198
Comments
Hey @ryantimjohn, thanks for the issue! There's an important distinction between the snippet you have above, and the one I shared in #3450 (comment). There, I was using a dbt-core/core/dbt/parser/read_files.py Lines 47 to 67 in 40ae6b6
The primary goal is to power capabilities around partial parsing: If The code below does work just fine, though I get it's much less sleek: version: 2
sources:
- name: "{{ var('frakture_facebook')[0].name }}"
database: "{{ var('frakture_facebook')[0].database }}"
schema: "{{ var('frakture_facebook')[0].schema }}"
tables: "{{ var('frakture_facebook')[0].tables }}" I'm not sure we're going to be able to support this use case, without significant changes to some of the lowest-lying code in dbt. I wish I could get you the coolness you're after. |
Is there an existing issue for this?
Current Behavior
Hi there,
I've tried to reference vars with the method mentioned here by @jtcohen6 doesn't seem to be working:
#3450
I defined my variables like so:
And then tried to reference them like this:
But got this error:
I know the variable is correctly formatted because when I reference it in a .sql statement like so:
{{ var('frakture_facebook')}}
I get:
[{'name': 'frakture_facebook', 'database': 'bsd-vera', 'schema': 'src_frakture', 'tables': [{'name': 'facebook_bizman_hdx_ad_summary_by_date_pivot'}, {'name': 'facebook_bizman_hdx_message'}]}]
Expected Behavior
The vars should be referenced in the source yml and correctly parse as sources.
Steps To Reproduce
Relevant log output
Environment
What database are you using dbt with?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: