diff --git a/.changes/unreleased/Fixes-20240323-124558.yaml b/.changes/unreleased/Fixes-20240323-124558.yaml new file mode 100644 index 00000000000..b36173325ba --- /dev/null +++ b/.changes/unreleased/Fixes-20240323-124558.yaml @@ -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 diff --git a/core/dbt/compilation.py b/core/dbt/compilation.py index 388713842ed..09695fc59d7 100644 --- a/core/dbt/compilation.py +++ b/core/dbt/compilation.py @@ -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 diff --git a/tests/functional/list/test_list.py b/tests/functional/list/test_list.py index b636bf20d39..4eb8cb8e2f9 100644 --- a/tests/functional/list/test_list.py +++ b/tests/functional/list/test_list.py @@ -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"]