From bdaf2ef860a867a9136d78f65ec6193f5f085524 Mon Sep 17 00:00:00 2001 From: pgoslatara Date: Mon, 25 Sep 2023 20:29:40 +0200 Subject: [PATCH] Adding emit_datasets param to DbtBaseOperator --- cosmos/operators/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cosmos/operators/base.py b/cosmos/operators/base.py index b61dbd5fb..47985f472 100644 --- a/cosmos/operators/base.py +++ b/cosmos/operators/base.py @@ -56,6 +56,8 @@ class DbtBaseOperator(BaseOperator): (i.e. /home/astro/.pyenv/versions/dbt_venv/bin/dbt) :param dbt_cmd_flags: List of flags to pass to dbt command :param dbt_cmd_global_flags: List of dbt global flags to be passed to the dbt command + :param emit_datasets: If enabled model nodes emit Airflow Datasets for downstream cross-DAG dependencies. + Defaults to True """ template_fields: Sequence[str] = ("env", "vars") @@ -102,6 +104,7 @@ def __init__( dbt_executable_path: str = get_system_dbt(), dbt_cmd_flags: list[str] | None = None, dbt_cmd_global_flags: list[str] | None = None, + emit_datasets: bool = True, **kwargs: Any, ) -> None: self.project_dir = project_dir @@ -127,6 +130,7 @@ def __init__( self.dbt_executable_path = dbt_executable_path self.dbt_cmd_flags = dbt_cmd_flags self.dbt_cmd_global_flags = dbt_cmd_global_flags or [] + self.emit_datasets = emit_datasets super().__init__(**kwargs) def get_env(self, context: Context) -> dict[str, str | bytes | os.PathLike[Any]]: