From 6d09ee5d877364309f1739b27a66b126a3fc4f08 Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Mon, 17 Jul 2023 12:07:08 +0100 Subject: [PATCH] Remove project pipeline_dir as it is redundant --- cosmos/dbt/project.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cosmos/dbt/project.py b/cosmos/dbt/project.py index 4a7adbbaf..df3a8bcaa 100644 --- a/cosmos/dbt/project.py +++ b/cosmos/dbt/project.py @@ -10,7 +10,6 @@ class DbtProject: name: str root_dir: Path - pipeline_dir: Path | None = None models_dir: Path | None = None seeds_dir: Path | None = None snapshots_dir: Path | None = None @@ -19,29 +18,30 @@ class DbtProject: _cosmos_created_profile_file: bool = False def __post_init__(self): - if self.pipeline_dir is None: - self.pipeline_dir = self.root_dir / self.name if self.models_dir is None: - self.models_dir = self.pipeline_dir / "models" + self.models_dir = self.dir / "models" if self.seeds_dir is None: - self.seeds_dir = self.pipeline_dir / "seeds" + self.seeds_dir = self.dir / "seeds" if self.snapshots_dir is None: - self.snapshots_dir = self.pipeline_dir / "snapshots" + self.snapshots_dir = self.dir / "snapshots" if self.profile_path is None: - self.profile_path = self.pipeline_dir / "profiles.yml" + self.profile_path = self.dir / "profiles.yml" @property def dir(self) -> Path: + """ + Path to dbt pipeline, defined by self.root_dir and self.name. + """ return self.root_dir / self.name def is_manifest_available(self) -> bool: """ - Checks if the `dbt` project manifest is set and if the file exists. + Check if the `dbt` project manifest is set and if the file exists. """ return self.manifest_path and Path(self.manifest_path).exists() def is_profile_yml_available(self) -> bool: """ - Checks if the `dbt` profiles.yml file exists. + Check if the `dbt` profiles.yml file exists. """ return Path(self.profile_path).exists()