Skip to content

Commit

Permalink
Remove existence checks in _validate_top_level_objects as the lists…
Browse files Browse the repository at this point in the history
… are guaranteed
  • Loading branch information
QMalcolm committed Oct 25, 2023
1 parent f7759df commit a58d7e6
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions dbt_semantic_interfaces/validations/unique_valid_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,24 +201,17 @@ def _validate_top_level_objects(semantic_manifest: SemanticManifest) -> List[Val
"""Checks names of objects that are not nested."""
issues: List[ValidationIssue] = []

if semantic_manifest.semantic_models:
issues.extend(
UniqueAndValidNameRule._validate_top_level_objects_of_type(
semantic_manifest.semantic_models, "semantic model"
)
issues.extend(
UniqueAndValidNameRule._validate_top_level_objects_of_type(
semantic_manifest.semantic_models, "semantic model"
)
)

if semantic_manifest.metrics:
issues.extend(
UniqueAndValidNameRule._validate_top_level_objects_of_type(semantic_manifest.metrics, "metric")
)
issues.extend(UniqueAndValidNameRule._validate_top_level_objects_of_type(semantic_manifest.metrics, "metric"))

if semantic_manifest.saved_queries:
issues.extend(
UniqueAndValidNameRule._validate_top_level_objects_of_type(
semantic_manifest.saved_queries, "saved query"
)
)
issues.extend(
UniqueAndValidNameRule._validate_top_level_objects_of_type(semantic_manifest.saved_queries, "saved query")
)

return issues

Expand Down

0 comments on commit a58d7e6

Please sign in to comment.