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
8 changes: 6 additions & 2 deletions cosmos/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,13 @@ class ExecutionConfig:
async_py_requirements: list[str] | None = None

def __post_init__(self, dbt_project_path: str | Path | None) -> None:
if self.invocation_mode and self.execution_mode not in (ExecutionMode.LOCAL, ExecutionMode.VIRTUALENV):
if self.invocation_mode and self.execution_mode not in (
ExecutionMode.WATCHER,
ExecutionMode.LOCAL,
ExecutionMode.VIRTUALENV,
):
raise CosmosValueError(
"ExecutionConfig.invocation_mode is only configurable for ExecutionMode.LOCAL and ExecutionMode.VIRTUALENV."
"ExecutionConfig.invocation_mode is only configurable for ExecutionMode.WATCHER, ExecutionMode.LOCAL, and ExecutionMode.VIRTUALENV."
)
if self.execution_mode == ExecutionMode.VIRTUALENV:
if self.invocation_mode == InvocationMode.DBT_RUNNER:
Expand Down
6 changes: 3 additions & 3 deletions dev/dags/example_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
operator_args["trigger_rule"] = "all_success"


from cosmos.constants import InvocationMode

# [START example_watcher]
example_watcher = DbtDag(
# dbt/cosmos-specific parameters
execution_config=ExecutionConfig(
execution_mode=ExecutionMode.WATCHER,
),
execution_config=ExecutionConfig(execution_mode=ExecutionMode.WATCHER, invocation_mode=InvocationMode.DBT_RUNNER),
project_config=ProjectConfig(DBT_PROJECT_PATH),
profile_config=profile_config,
operator_args=operator_args,
Expand Down