calogica / dbt-date

Date-related macros for dbt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflict with `dbt-utils` package due to this repo's packages.yml

ilmari-aalto opened this issue · comments

I'm trying out the new dbt-expectations package which installs dbt-date via its packages.yml.
Now dbt-date installs dbt-utils via its packages.yml.

But we already have a separate entry for the package dbt-utils in our project packages.yml, like this:

packages:
  - git: "https://github.com/fishtown-analytics/dbt-utils.git"
    revision: 0.6.2
  - git: "https://github.com/calogica/dbt-expectations.git"
    revision: 0.2.0

Having dbt-utils imported twice causes an error when running dbt deps:

Running with dbt=0.18.1
Encountered an error:
Found duplicate project "dbt_utils". This occurs when a dependency has the same project name as some other dependency.

The obvious solution is to remove the dbt-utils entry from our project packages.yml. But I quite like having it explicitly imported, and not via a dependency of a dependency which is not very obvious, if you see what I mean.

Do you think that there's anything to be done from the point of view of your package dbt-date?
Or perhaps we should open an issue in the main dbt repository for better resolution of package dependencies so that this type of error would not present itself? I.e. so that dbt would figure out that in fact it's the same package and there's not conflict.

Happy to chat over dbt Slack or comment in this issue!

Hi, sorry, just getting to this. Yes, the only fix here right now is to remove dbt-utils from your packages.yml, I had highlighted that in the README:

FYI: this package includes dbt-utils so there's no need to also import dbt-utils in your local project. 
(In fact, you may get an error if you do.)

One fix from the dbt-date side would be to force users to install dependent packages and correct versions, which would likely lead to even more issues, so I'm hesitant to do so.

I'm going to close this issue, but feel free to reopen it if you feel like there's something specific we can do to help you out here.

Hi @clausherther !

Sorry on my side actually because I asked to it on the core dbt side and there actually is a way to do it correctly, but I forgot to close this issue. See this response to my issue in dbt core: dbt-labs/dbt-core#2956

So perhaps in dbt-expectations docs you could recommend the dbt package config instead of git config, as described in the issue I'm linking?

@ilmari-aalto good call, will do! Internally dbt-expections and dbt-date use the package syntax already, but I'll update the docs for the package usage themselves. Thanks!