-
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-3301] [Bug] sources are not disabled in dbt_project.yml #8960
Comments
Hey Elize - after doing some troubleshooting, it looks like our docs might actually be wrong / misleading. If your source is nested in a yml file in a subfolder, you will need to supply the path to that yml file plus the source name in the
Can you give something like that a try (depending on the path to your source yml file)? In part this is confusing, because the output of I think these are the docs we need to update:
Looks like we had a similar issue / confusion come up for disabling tests #8876 |
hey @graciegoheen ! ok thank you for clarifying this and had a few reads to understand the change. I've created a PR here which addresses the above and also adds the resource paths doc to the sidebar. for some reason, it wasn't on there and i think it should be on the sidebar? can i ask you to take a look to ensure it's technically right? |
@graciegoheen Yes when I provide the project name and path I get the expected behavior. Thank you for your help here everyone~ |
PR clarifies how to disable sources and addresses core issue dbt-labs/dbt-core#8960 and adds the resource paths page to the sidebar. This also Resolves #4313
How to disable a single table within a sourceSuppose you have a super tiny dbt project that looks like this:
And you have two source tables defined within # models/subdirectory_name/_sources.yml
version: 2
sources:
- name: my_source_name
tables:
- name: my_source_table_1
- name: my_source_table_2 You can list them like this: $ dbt list
...
00:00:28 Found 2 sources, 0 exposures, 0 metrics, 401 macros, 0 groups, 0 semantic models
source:your_project_name.my_source_name.my_source_table_1
source:your_project_name.my_source_name.my_source_table_2 Then to disable just the first table, you'd do the following within # dbt_project.yml
name: "your_project_name"
version: "1.0.0"
config-version: 2
profile: "sandcastle"
sources:
your_project_name:
subdirectory_name:
my_source_name:
my_source_table_1:
+enabled: false And when you do another listing, you'll see it's been disabled: $ dbt list
...
00:01:10 Found 1 source, 0 exposures, 0 metrics, 401 macros, 0 groups, 0 semantic models
source:your_project_name.my_source_name.my_source_table_2 Potential mistakeBut if you don't get the hierarchy within
|
Previews: - [resource-path](https://docs-getdbt-com-git-dbeatty-sources-enabled-config-dbt-labs.vercel.app/reference/resource-configs/resource-path#apply-config-to-a-source-nested-in-a-subfolder) - [source-configs](https://docs-getdbt-com-git-dbeatty-sources-enabled-config-dbt-labs.vercel.app/reference/source-configs#configuring-sources) ## What are you changing in this pull request and why? Just tested this out and wrote an example [here](dbt-labs/dbt-core#8960 (comment)). Using the learnings to update the docs. Updated to use the lowest level of granularity (which is a source table). ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) and [About versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) so my content adheres to these guidelines. - [x] I have verified that the preview looks good - [x] I have verified that the code example works
Is this a new bug in dbt-core?
Current Behavior
Disabling an entire source in
dbt_project.yml
does not work for in-project sources although it does work in thesources.yml
or for package sources. For example, the following indbt_project.yml
will not disable the source:But in
sources.yml
this will disable the source:Expected Behavior
The ability to toggle the
enabled
configuration across all configuration levels.Steps To Reproduce
enabled
config to `dbt_project.ymlRelevant log output
No response
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: