-
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-748] [Enhancement] dbt deps
should resolve multiple packages with same git:
repo and unique subdirectory:
#5374
Comments
dbt deps
cannot resolve multiple private packages in same git:
repo with unique subdirectory:
and revision:
configurationsdbt deps
cannot resolve multiple private packages in same git:
repo with unique subdirectory:
and revision:
configurations
dbt deps
cannot resolve multiple private packages in same git:
repo with unique subdirectory:
and revision:
configurationsdbt deps
cannot resolve multiple private packages in same git:
repo with unique subdirectory:
and revision:
config
dbt deps
cannot resolve multiple private packages in same git:
repo with unique subdirectory:
and revision:
configdbt deps
cannot resolve multiple packages in packages.yml
when in same git:
repo with unique subdirectory:
and revision:
configs
dbt deps
cannot resolve multiple packages in packages.yml
when in same git:
repo with unique subdirectory:
and revision:
configsdbt deps
cannot resolve multiple packages in packages.yml
when in same git:
repo but with unique subdirectory:
and revision:
configs
@GClunies Thanks for the clear write-up! I think it's fair to say that this isn't part of the intended or expected support that we have for To make a long story short, the In the meantime, I think you might be able to get this working by adding a new "project" within https://github.com/Surfline/wavetrak-segment, that installs the others as |
dbt deps
cannot resolve multiple packages in packages.yml
when in same git:
repo but with unique subdirectory:
and revision:
configsdbt deps
should resolve multiple packages with same git:
repo and unique subdirectory:
Thanks for getting back to me so quickly @jtcohen6, I really appreciate it. I had previously thought that the To provide some context as to how I got here, the dbt packages described in my original issue are being created by Reflekt, an open-source tool I am developing to template dbt packages that model and document the events in a tracking plan from tools like Avo and Segment Protocols. My original framework was that each tracking plan (if there were multiple) would have its own corresponding dbt package, hence multiple packages in a single repo (that holds a Reflekt project). Seems that assumption I made has come back to bite me! As for solutions to my issue, I see 3 options:
I think my safest bet is option 3. Option 2 is tempting, but also feels like a rabbit hole. |
@GClunies I'm going to close this out since it looks like you implemented Option 3 above. If you disagree or still have an ask, feel free to re-open |
Hi @leahwicz, I did implement option 3 above. But this was only in response to the unexpected behavior I outlined in the original issue description. I think in an ideal world, dbt-core would support the expected behavior I described (that's my ask). I personally feel it's a valid enhancement request. But I can empathize that solving edge cases like this is likely not a priority. Maybe an update to the docs clarifying the limitations of the |
Sorry about that @GClunies! I am opening this back up to keep track of the feature request. We most likely won't be able to prioritize this in the near future so I'm going to put the |
Hey, I also run into the same issue. My team designed a GitHub repository with a subfolder per dbt project (with a dbt project per data source) + 1 release per dbt_project. We just discovered that referencing multiple packages that are subfolders of the same repo doesn't work out. |
Is this planned for any near future delivery? In the docs, it feels like dbt is hinting this should work with a monorepo - doesn't specifically talk about reaching out for multiple dbt projects within the monorepo from a single dependent dbt project, but it is unexpected and should ideally be made part of the docs. |
+1 I'm in the exact same boat as @amirbtb , any news on this @jtcohen6 ? |
+1 from me as well, ran into this issue at my work |
+1 dbt Cloud customer. This customer has multiple projects in a single repository to align with their internal git best practices. They have several private packages, and want to be able to include them in a main project while keeping all packages in a single directory. |
+1 would be great to have this |
@jtcohen6 Andddd I'm here now, lmao--just painfully discovered that I can't use these like I intended to once I started layering on multiple private packages from the same repo. |
@gem7318 Nice to see you again, and so soon :) Coming back to this proposal from above:
While I think it might be tricky — if you (or someone in this thread) wanted to take a crack at this, I wouldn't be opposed. The starting point would be incorporating the It is worth thinking through the risk of cyclical dependencies, which are still an issue (I believe). As described there, it might be possible to do something nice around cycle detection / gracefully handle a recursion error. |
Likewise :) And yes agreed - I'm going on vacation at the end of the week and will spend some flight-time looking at the source code trying getting my head around it. Off the bat though I agree that cyclical dependencies is the 'gotcha' that make this of non-zero complexity. |
+1 from me as well, we ran into this issue |
Hi all, I'm simply posting an update here because I've been working on a solution which is working perfectly for our use case which is the same as @gem7318 and @amirbtb. We also have a mono repo with multiple DBT packages inside them and we needed to have a way to be able to import multiple git packages within the same "main package" packages:
- package: "calogica/dbt_date"
version: [ ">=0.5.4", "<0.8.0" ]
- package: "dbt-labs/dbt_utils"
version: [ ">=1.0.0", "<2.0.0" ]
- git: "git@github.com:acme/git-repo.git"
subdirectory: "dbt-source-pkg-1"
revision: "dbt-source-pkg-1-v0.1.12"
- git: "git@github.com:acme/git-repo.git"
subdirectory: "dbt-source-pkg-2"
revision: "dbt-source-pkg-2-v0.1.2" The following will import correctly ❯ dbt deps
14:49:31 Running with dbt=1.5.1
14:49:41 Installing calogica/dbt_date
14:49:41 Installed from version 0.7.2
14:49:41 Up to date!
14:49:41 Installing dbt-labs/dbt_utils
14:49:42 Installed from version 1.1.1
14:49:42 Up to date!
14:49:42 Installing git@github.com:acme/git-repo.git/dbt-source-pkg-1
14:49:43 Installed from revision dbt-source-pkg-1-v0.1.12
14:49:43 and subdirectory dbt-source-pkg-1
14:49:43 Installing git@github.com:acme/git-repo.git/dbt-source-pkg-2
14:49:44 Installed from revision dbt-source-pkg-2-v0.1.2
14:49:44 and subdirectory dbt-source-pkg-2 I'll have time to create the PR tonight with updated unit tests |
any update on this? This is an important feature for bigger projects like ours. |
@philippeboyd Thanks for your implementation of this long-desired feature! |
Is there an existing issue for this?
Current Behavior
I have a single GitHub repo where I have defined multiple private dbt packages (i.e. a monorepo with >1 dbt packages) in a
dbt_packages/
directory. Each dbt package is in it's own subdirectory in the repo like so:Each dbt package contains models for Segment event data, modeled in a structure like so:
In my dbt project, I have uniquely referenced each package in my
packages.yml
like so:I would have thought that with this information, dbt would be able to pull each private dbt package from my repo, its respective
subdirectory:
, andrevision:
(Git tag), but instead I get the error.I am actually pointing dbt to 3 separate dbt packages in the same repo, which are unique identified by the config in my
packages.yml
, but dbt seems to confused by this. Perhaps I am pushing the limits of how thegit:
config inpackages.yml
was intended to be used?I am not super familiar with the dbt-core codebase, but the error appears to be originating from the logic here.
Expected Behavior
With the
packages.yml
provide in the previous section of this issue, I would expect dbt to be able to resolve each package like so:It seems strange to me that this pattern does not work for private packages specified using the
git:
. Having to maintain each private package in a separate repo does not seem practical.Steps To Reproduce
dbt deps
Relevant log output
The logs were pretty light when I looked
Environment
What database are you using dbt with?
redshift
Additional Context
dbt deps
works when I specifying a single dbt packages from the Git repo.The text was updated successfully, but these errors were encountered: