Skip to content

Commit

Permalink
early returns
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-connors-3 committed Feb 29, 2024
1 parent 8fb895f commit ec95adf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dbt_meshify/utilities/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,30 +182,29 @@ def generate_reference_update(
model_code=code,
)

change = FileChange(
return FileChange(
operation=Operation.Update,
entity_type=EntityType.Code,
identifier=downstream_node.name,
path=downstream_project.resolve_file_path(downstream_node),
data=updated_code,
)
return change

if isinstance(downstream_node, Exposure) or isinstance(downstream_node, SemanticModel):
elif isinstance(downstream_node, Exposure) or isinstance(downstream_node, SemanticModel):
is_exposure = isinstance(downstream_node, Exposure)
data = self.update_yml_resource_references(
project_name=project_name,
upstream_resource_name=upstream_node.name,
resource=downstream_node,
)
change = ResourceChange(
return ResourceChange(
operation=Operation.Update,
entity_type=EntityType.Exposure if is_exposure else EntityType.SemanticModel,
identifier=downstream_node.name,
path=downstream_project.resolve_file_path(downstream_node),
data=data,
)
return change
raise Exception("Invalid node type provided to generate_reference_update.")

def update_child_refs(
self,
Expand Down

0 comments on commit ec95adf

Please sign in to comment.