Skip to content
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-3396] [Bug] dbt deps --add-package doesn't work when packages.yml contains warn-unpinned: false #9104

Open
2 tasks done
dbeatty10 opened this issue Nov 16, 2023 · 0 comments
Assignees
Labels
backport 1.7.latest bug Something isn't working Medium Severity bug with minor impact that does not have resolution timeframe requirement
Milestone

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Nov 16, 2023

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

As originally reported by @seub in #9076 (comment), the following exception is raised with an accompanying stack trace when packages.yml contains warn-unpinned: false and dbt deps --add-package is executed:

TypeError: argument of type 'bool' is not iterable

Expected Behavior

The --add-package argument should execute without producing an exception and a stack trace.

Steps To Reproduce

packages.yml

packages:
 - git: https://github.com/fivetran/dbt_amplitude
   warn-unpinned: false

Running this will raise the exception:

dbt deps --add-package dbt-labs/dbt_utils@1.0.0

Removing warn-unpinned: false and re-running the command works fine.

Relevant log output

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

Environment

- OS:
- Python: 3.9.16
- dbt: dbt-core 1.7.1, dbt-snowflake 1.7.0

Which database adapter are you using with dbt?

snowflake

Additional Context

#9076 (comment)

Looking at the code in dbt-core, it seems to me that the in on line 138 should be replaced by an ==.

(Better yet, first find the correct value for val, i.e. the one where the key is package/git/local/tarball. Isn't there a method for that somewhere?)

@dbeatty10 dbeatty10 added bug Something isn't working triage labels Nov 16, 2023
@github-actions github-actions bot changed the title [Bug] dbt deps --add-package doesn't work when packages.yml contains warn-unpinned: false [CT-3396] [Bug] dbt deps --add-package doesn't work when packages.yml contains warn-unpinned: false Nov 16, 2023
@dbeatty10 dbeatty10 removed the triage label Nov 16, 2023
@graciegoheen graciegoheen added Medium Severity bug with minor impact that does not have resolution timeframe requirement backport 1.7.latest High Severity bug with significant impact that should be resolved in a reasonable timeframe and removed Medium Severity bug with minor impact that does not have resolution timeframe requirement labels Nov 16, 2023
@martynydbt martynydbt added this to the v1.8 milestone Feb 8, 2024
@martynydbt martynydbt added Medium Severity bug with minor impact that does not have resolution timeframe requirement and removed High Severity bug with significant impact that should be resolved in a reasonable timeframe labels Feb 12, 2024
@martynydbt martynydbt modified the milestones: v1.8, v1.9 Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.7.latest bug Something isn't working Medium Severity bug with minor impact that does not have resolution timeframe requirement
Projects
None yet
Development

No branches or pull requests

4 participants