Skip to content

Commit

Permalink
Merge pull request #71 from DalgoT4D/delete-model-support
Browse files Browse the repository at this point in the history
  • Loading branch information
fatchat authored Mar 4, 2024
2 parents 8c1e774 + 7794732 commit 9af8ed3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dbt_automation/utils/dbtproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9af8ed3

Please sign in to comment.