-
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
dbt packages.yml conflict: Found duplicate project "dbt_utils" #2956
Comments
Hey @ilmari-aalto, the best solution here is to use the packages:
- package: fishtown-analytics/dbt_utils
version: 0.6.2
- package: calogica/dbt_expectations
version: 0.2.0 This is what we recommend in the docs because it solves exactly the problem you're raising here. It's available for any package hosted at hub.getdbt.com. dbt is then able to figure out that
|
Amazing, thanks so much for your answer @jtcohen6! I'm very glad that this had been thought of! It works with a minor tweak to your example, had to change
|
@ilmari-aalto you're so right, I just edited my comment above to reflect. Thank you! |
Describe the bug
dbt errors when importing the same package several times due to package dependencies.
Consider the following config in
packages.yml
:Note how we first import
dbt-utils
directly. Next we importdbt-expectations
which in turn installsdbt-date
as seen in itspackage.yml
: https://github.com/calogica/dbt-expectations/blob/main/packages.yml#L2. Nowdbt-date
requiresdbt-utils
as we can see in the correspondingpackage.yml
: https://github.com/calogica/dbt-date/blob/main/packages.yml#L2.So we end up importing
dbt-utils
twice: once explicitly, and a second time indirectly because it's referenced as a dependency in other packages. Unfortunately, this leads to the following error when executingdbt deps
:Found duplicate project "dbt_utils". This occurs when a dependency has the same project name as some other dependency.
Steps To Reproduce
Use the
package.yml
definition from above and rundbt deps
. This will lead dbt to error with the message:Found duplicate project "dbt_utils". This occurs when a dependency has the same project name as some other dependency.
Expected behavior
dbt knows that both references point to the same
dbt-utils
, imports it just once, and is happy.Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
macOS Catalina 10.15.7
The output of
python --version
:Additional context
Of course we could remove the explicit entry for
dbt-utils
. But we want to make sure thatdbt-utils
will always be there, and thepackage.yml
of the second package could change. So we don't want to rely on it to havedbt-utils
available.There could also be two distinct packages, and both of them would depend on
dbt-utils
(for example). Presumably you'd then get the same error and couldn't have both packages installed at the same time.The text was updated successfully, but these errors were encountered: