From c7812e7199a86064457ecefdc4544cb7383f5f75 Mon Sep 17 00:00:00 2001 From: Matthieu Caneill Date: Tue, 21 May 2024 09:47:04 +0200 Subject: [PATCH] Add rule: model should have an owner (#20) --- src/dbt_score/rules/generic.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dbt_score/rules/generic.py b/src/dbt_score/rules/generic.py index d73807a..78a5be3 100644 --- a/src/dbt_score/rules/generic.py +++ b/src/dbt_score/rules/generic.py @@ -21,3 +21,10 @@ def columns_have_description(model: Model) -> RuleViolation | None: message=f"The following columns lack a description: " f"{', '.join(invalid_column_names)}." ) + + +@rule +def has_owner(model: Model) -> RuleViolation | None: + """A model should have an owner.""" + if not model.meta.get("owner"): + return RuleViolation(message="Model lacks an owner.")