-
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
[CT-3382] [Bug] dbt deps --add-package
does not work
#9076
Comments
dbt deps --add-package
does not workdbt deps --add-package
does not work
Thanks for reporting this @seub ! I opened a PR to fix the documentation here: dbt-labs/docs.getdbt.com#4470 Could you try out these examples and see if they work for you? # add package from hub (--source arg defaults to "hub")
dbt deps --add-package dbt-labs/dbt_utils@1.0.0
# add package from hub with semantic version range
dbt deps --add-package dbt-labs/snowplow@">=0.7.0,<0.8.0"
# add package from git
dbt deps --add-package https://github.com/fivetran/dbt_amplitude@v0.3.0 --source git
# add package from local
dbt deps --add-package /opt/dbt/redshift --source local
# add package to packages.yml and package-lock.yml WITHOUT actually installing dependencies
dbt deps --add-package dbt-labs/dbt_utils@1.0.0 --dry-run |
Thanks @dbeatty10. I tried these examples and they all result in a similar error: dbt deps --add-package dbt-labs/dbt_utils@1.0.0
03:02:33 Running with dbt=1.7.1
03:02:34 Encountered an error:
argument of type 'bool' is not iterable
03:02:34 Traceback (most recent call last):
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 90, in wrapper
result, success = func(*args, **kwargs)
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 75, in wrapper
return func(*args, **kwargs)
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 151, in wrapper
return func(*args, **kwargs)
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 197, in wrapper
return func(*args, **kwargs)
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/cli/main.py", line 492, in deps
results = task.run()
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/task/deps.py", line 207, in run
self.add()
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/task/deps.py", line 160, in add
packages_yml = self.check_for_duplicate_packages(packages_yml)
File "/path/to/project/.venv/lib/python3.9/site-packages/dbt/task/deps.py", line 138, in check_for_duplicate_packages
if self.args.add_package["name"] in val:
TypeError: argument of type 'bool' is not iterable I used Python 3.9.16, dbt-core 1.7.1, dbt-snowflake 1.7.0. |
Oof. What are the contents of If you start with no |
Ah, I see, it doesn't like If I start with this packages.yml: packages:
- git: https://github.com/fivetran/dbt_amplitude then everything works fine, however I get the error with this: packages:
- git: https://github.com/fivetran/dbt_amplitude
warn-unpinned: false Looking at the code in dbt-core, it seems to me that the (Better yet, first find the correct value for |
[Preview](https://docs-getdbt-com-git-dbeatty-fix-dbt-deps-add-package-dbt-labs.vercel.app/reference/commands/deps) ## What are you changing in this pull request and why? Fixing the code examples per dbt-labs/dbt-core#9076 by using test examples from dbt-labs/dbt-core#8408 ## 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've checked that the code examples work - [x] I've confirmed that the preview renders correctly
Thanks again for reporting this and helping get to the bottom of this @seub ! I just opened #9104, and I'm going to close this one in favor of it and dbt-labs/docs.getdbt.com#4470. |
Is this a new bug in dbt-core?
Current Behavior
The
dbt deps --add-package
command does not work. Unless I'm missing something, it's not doing anything.Also, note that the doc doesn't give the correct syntax:
add --package
instead of--add-package
--add
flag is mentionedExpected Behavior
Adds entry to
packages.yml
Steps To Reproduce
dbt deps --add-package dbt-labs/dbt_utils --version 1.0.0
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: