-
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
Support for configuring sources using resource paths #3298
Comments
Hey @kdeggelman, thanks for opening! There are two prerequisites to this, and I'll say more about each of them below:
In dbt, resources are configured in This is not correct in the docs, which say:
There should be another item, between the first and the second: the relative path of the source's YAML definition. Here, for instance, is a snippet from a source's "source.my_project.my_src.my_tbl": {
"fqn": [
"my_project",
"subfolder",
"my_src",
"my_tbl"
], And I would configure it like so: sources:
my_project:
subfolder: # required for this to work!
my_src:
+enabled: False Now, for the second matter at hand: The attributes of source definitions are technically resource properties, rather than node configs. Today, sources can only carry one general node config: This is a technical distinction, and not a tremendously meaningful one. Ideally, we'll manage to do away with it before dbt v1.0, so that it will be possible to set property-configs like: sources:
my_package:
my_subfolder:
+database: raw There are two takeaways for this:
In the meantime, I'm going to close this issue, since the required code change is well captured in the existing issue—it's just going to be a tricky maneuver to pull off. |
@jtcohen6 Thanks for the thorough response, I learned a lot from reading it. |
Describe the feature
I'd like to be able to configure sources in
dbt_project.yml
using theresource-path
pattern in a similar way to how I configure models. My current understanding is that I can only configure sources using package name, source name, and table name. This forces me to configure each source individual as opposed to configuring multiple sources within a directory.Describe alternatives you've considered
Right now I have to add
database: "<database name>"
to every source that lives in a different database.Another option would be to specify the
database
on a per-file level to avoid having to copydatabase: "<database name>"
in every source in that file.Additional context
We use BigQuery and have data spread between multiple projects (databases). Within my
models/
directory I have a couple directories that each have a file likesrc_other_database.sql
that define a bunch of different datasets (sources) that all live in that project.Who will this benefit?
In general, it seems like a good idea have similar functionality for model configuration and source configuration. This feature would help keep source definitions "DRY" for many projects.
Are you interested in contributing this feature?
I'm happy to help any way that I can, though I suspect the actual implementation would be better left to some of the core contributors.
The text was updated successfully, but these errors were encountered: