Skip to content

Commit

Permalink
refactor: move type casting from validation function to setter function
Browse files Browse the repository at this point in the history
  • Loading branch information
ewagner-verta committed Aug 29, 2023
1 parent 86b1032 commit 93df142
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/verta/verta/pipeline/_pipeline_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def set_steps(
TypeError
If ``steps`` is not a set of PipelineStep objects.
"""
self._steps = self._validate_steps(steps)
self._steps = set(self._validate_steps(steps))
return self.steps

def _validate_steps(
Expand Down Expand Up @@ -98,7 +98,7 @@ def _validate_steps(
f"individual steps of a PipelineGraph must be type"
f" PipelineStep, not {type(step)}."
)
return set(steps)
return steps

@classmethod
def _from_definition(
Expand Down
4 changes: 2 additions & 2 deletions client/verta/verta/pipeline/_pipeline_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def set_predecessors(
If the provided value for ``steps`` is not a set of PipelineStep objects.
"""
if steps:
self._predecessors = self._validate_predecessors(steps)
self._predecessors = set(self._validate_predecessors(steps))
return self.predecessors
self._predecessors = set()
return self.predecessors
Expand Down Expand Up @@ -196,7 +196,7 @@ def _validate_predecessors(
f"individual predecessors of a PipelineStep must be type"
f" PipelineStep, not {type(step)}."
)
return set(predecessors)
return predecessors

def _get_registered_model(self) -> RegisteredModel:
"""Fetch the registered model associated with this step's model version.
Expand Down

2 comments on commit 93df142

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker Tag: VRD-894_pipelines_CRUD-2023-08-29T16-20-42--93df142

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Total coverage (common): 15.14
Total coverage (server): 61.25

Changed Files coverage (common): coverage 100
Changed Files coverage (server): 100

Please sign in to comment.