-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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-699] [Bug] Source freshness enabled config doesn't read variables #5311
Comments
Are you trying to override a source that is provided by a different package (i.e. not your root project)? Because in order for source configs to override a source from a different package, you need to set the attribute: "overrides: <package_name>". https://docs.getdbt.com/reference/resource-properties/overrides |
Correct, I am trying to disable a single source table from the dbt_jira_source package. I didn't think leveraging the |
@fivetran-joemarkiewicz The issue here is that If you're actually defining the sources in the package, you can use those variables in the sources' # models/src_jira.yml
version: 2
sources:
- name: jira
tables:
- name: sprint
description: Table of all sprints.
config:
enabled: "{{ var('jira_using_sprints', true) }}" If you're trying (from a separate root project) to disable a single source table from an installed package, your better bet is to use a simple boolean |
@jtcohen6 this is exactly what I was looking for! I had attempted the below and noticed it wasn't working. It looks like I just needed the # models/src_jira.yml
version: 2
sources:
- name: jira
tables:
- name: sprint
description: Table of all sprints.
enabled: "{{ var('jira_using_sprints', true) }}" Is this behavior only available in dbt-core >= v1.1.0? Also, thank you for sharing the #4938 discussion! That is incredibly interesting and I look forward to seeing the vibe evolution of vars 😄 |
@fivetran-joemarkiewicz Glad to hear that's working! And correct, this is v1.1.0+ only |
Is there an existing issue for this?
Current Behavior
When leveraging the
sources
config to disable sources within a package, I am noticing that the use of variables with the intent to be overwritten does not work. See the example below:In my root
dbt_project.yml
Expected Behavior
The default variables is required otherwise I get the following error.
Therefore, I set the default value to true, but found that this default value is the only value that is used. I would expect dbt would use the variable I declare in the
vars
section. This may not be that big of a deal of individual dbt projects. However, this is pretty crucial for dbt packages to leverage various variables and allow users to override them. It seems users cannot override these source variables however.Steps To Reproduce
sources
config.vars
config.dbt source freshness
and see the variable you declared is not used.Relevant log output
Environment
What database are you using dbt with?
bigquery
Additional Context
Similar to what I said above. You could just hard code the values for the sources and see it works fine. However, for packages we leverage the variables so users can change the behavior of the package. I would expect using the same variable to disable features in other parts of the package would also be able to disable the source itself.
The text was updated successfully, but these errors were encountered: