Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cosmos/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def override_configuration(
if execution_config.invocation_mode:
operator_args["invocation_mode"] = execution_config.invocation_mode

if execution_config.execution_mode in (ExecutionMode.LOCAL, ExecutionMode.VIRTUALENV):
if execution_config.execution_mode in (ExecutionMode.LOCAL, ExecutionMode.VIRTUALENV, ExecutionMode.WATCHER):
if "install_deps" not in operator_args:
operator_args["install_deps"] = project_config.install_dbt_deps
if "copy_dbt_packages" not in operator_args:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,14 @@ def test_validate_converter_fetches_project_name_from_render_config(
(ExecutionMode.KUBERNETES, {}, False, None),
(ExecutionMode.LOCAL, {}, False, False),
(ExecutionMode.VIRTUALENV, {}, False, False),
(ExecutionMode.WATCHER, {}, False, False),
(ExecutionMode.LOCAL, {}, True, True),
(ExecutionMode.VIRTUALENV, {}, True, True),
(ExecutionMode.WATCHER, {}, True, True),
(ExecutionMode.KUBERNETES, {"install_deps": True}, False, True),
(ExecutionMode.LOCAL, {"install_deps": True}, False, True),
(ExecutionMode.VIRTUALENV, {"install_deps": True}, False, True),
(ExecutionMode.WATCHER, {"install_deps": True}, False, True),
],
)
@patch("cosmos.config.ProjectConfig.validate_project")
Expand All @@ -744,7 +747,7 @@ def test_project_config_install_dbt_deps_overrides_operator_args(
expected,
):
"""Tests that the value project_config.install_dbt_deps is used to define operator_args["install_deps"] if
execution mode is ExecutionMode.LOCAL or ExecutionMode.VIRTUALENV and operator_args["install_deps"] is not
execution mode is ExecutionMode.LOCAL, ExecutionMode.VIRTUALENV, or ExecutionMode.WATCHER and operator_args["install_deps"] is not
already defined.
"""
project_config = ProjectConfig(project_name="fake-project", dbt_project_path="/some/project/path")
Expand Down