Skip to content

Commit

Permalink
Only create the packages-install-path / dbt_packages folder durin…
Browse files Browse the repository at this point in the history
…g `dbt deps` (#9810)

* Changelog entry

* The packages-install-path should not be created by `dbt list`

* Only create packages-install-path during `dbt deps`
  • Loading branch information
dbeatty10 authored Apr 5, 2024
1 parent 96f5426 commit e81f7fd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240323-124558.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Only create the packages-install-path / dbt_packages folder during dbt deps
time: 2024-03-23T12:45:58.159017-06:00
custom:
Author: dbeatty10
Issue: 6985 9584
1 change: 0 additions & 1 deletion core/dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ def __init__(self, config) -> None:

def initialize(self):
make_directory(self.config.project_target_path)
make_directory(self.config.packages_install_path)

# creates a ModelContext which is converted to
# a dict for jinja rendering of SQL
Expand Down
7 changes: 7 additions & 0 deletions tests/functional/list/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ def project_config_update(self):
},
}

def test_packages_install_path_does_not_exist(self, project):
run_dbt(["list"])
packages_install_path = "dbt_packages"

# the packages-install-path should not be created by `dbt list`
assert not os.path.exists(packages_install_path)

def run_dbt_ls(self, args=None, expect_pass=True):
log_manager.stdout_console()
full_args = ["ls"]
Expand Down

0 comments on commit e81f7fd

Please sign in to comment.