diff --git a/dbt_automation/utils/dbtproject.py b/dbt_automation/utils/dbtproject.py index 62d8169..3947440 100644 --- a/dbt_automation/utils/dbtproject.py +++ b/dbt_automation/utils/dbtproject.py @@ -69,3 +69,13 @@ def write_model_config(self, schema: str, models: list, **kwargs) -> None: ) return self.strip_project_dir(models_filename) + + def delete_model(self, model_relative_path: Path): + """Delete a model; relative path will look like models/intermediate/example_model.sql""" + + model_path = Path(self.project_dir) / model_relative_path + if model_path.exists(): + model_path.unlink() + return True + + return False