Skip to content

Commit

Permalink
Ensure partial parsing appropriately deletes metrics generated from s…
Browse files Browse the repository at this point in the history
…emantic models
  • Loading branch information
QMalcolm committed Aug 3, 2023
1 parent 0690cbf commit e73be97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/dbt/parser/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,14 @@ def delete_schema_semantic_model(self, schema_file, semantic_model_dict):
elif unique_id in self.saved_manifest.disabled:
self.delete_disabled(unique_id, schema_file.file_id)

metrics = schema_file.metrics.copy()
for unique_id in metrics:
if unique_id in self.saved_manifest.metrics:
self.saved_manifest.metrics.pop(unique_id)
schema_file.semantic_models.remove(unique_id)
elif unique_id in self.saved_manifest.disabled:
self.delete_disabled(unique_id, schema_file.file_id)

def get_schema_element(self, elem_list, elem_name):
for element in elem_list:
if "name" in element and element["name"] == elem_name:
Expand Down

0 comments on commit e73be97

Please sign in to comment.