Skip to content

Commit 0811e46

Browse files
authored
Bugfix ProjectConfig install_dbt_deps (#1556)
`install_dbt_deps` is missing from the `ProjectConfig` `__init__` method, which is inconsistent with the [documentation](https://astronomer.github.io/astronomer-cosmos/configuration/project-config.html) and does not make sense. Closes: #1555
1 parent dfbef5c commit 0811e46

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cosmos/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class ProjectConfig:
152152
:param snapshots_relative_path: The relative path to the dbt snapshots directory within the project. Defaults to
153153
snapshots
154154
:param manifest_path: The absolute path to the dbt manifest file. Defaults to None
155+
:param manifest_conn_id: Name of the Airflow connection used to access the manifest file if it is not stored locally. Defaults to None
155156
:param project_name: Allows the user to define the project name.
156157
Required if dbt_project_path is not defined. Defaults to the folder name of dbt_project_path.
157158
:param env_vars: Dictionary of environment variables that are used for both rendering and execution. Rendering with
@@ -175,6 +176,7 @@ class ProjectConfig:
175176
def __init__(
176177
self,
177178
dbt_project_path: str | Path | None = None,
179+
install_dbt_deps: bool = True,
178180
models_relative_path: str | Path = "models",
179181
seeds_relative_path: str | Path = "seeds",
180182
snapshots_relative_path: str | Path = "snapshots",
@@ -228,6 +230,7 @@ def __init__(
228230
self.env_vars = env_vars
229231
self.dbt_vars = dbt_vars
230232
self.partial_parse = partial_parse
233+
self.install_dbt_deps = install_dbt_deps
231234

232235
def validate_project(self) -> None:
233236
"""

tests/test_config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ def test_init_with_project_path_only():
2828
assert project_config.snapshots_path == Path("path/to/dbt/project/snapshots")
2929
assert project_config.project_name == "project"
3030
assert project_config.manifest_path is None
31+
assert project_config.install_dbt_deps is True
32+
33+
34+
def test_init_with_project_path_and_install_dbt_deps_succeeds():
35+
"""
36+
Passing only dbt_project_path and install_dbt_deps should succeed and set install_dbt_deps to the value defined
37+
"""
38+
project_config = ProjectConfig(dbt_project_path="path/to/dbt/project", install_dbt_deps=False)
39+
assert project_config.install_dbt_deps is False
3140

3241

3342
def test_init_with_manifest_path_and_project_path_succeeds():

0 commit comments

Comments
 (0)