Skip to content

Commit

Permalink
Fix condition stop (#2363)
Browse files Browse the repository at this point in the history
This pull request fixes a condition in the `stop` method. Previously,
the method would raise a `ValueError` if `output_name` was not provided,
even if it was set to `None`. This pull request updates the condition to
only raise the `ValueError` if `output_name` is not provided and is not
set to `None`. This allows for more flexibility when calling the `stop`
method.
  • Loading branch information
anovazzi1 authored Jun 26, 2024
2 parents f74365e + 462a854 commit 99d3227
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def update_state(self, name: str, value: Any):
def stop(self, output_name: str | None = None):
if not output_name and self.vertex and len(self.vertex.outputs) == 1:
output_name = self.vertex.outputs[0]["name"]
else:
elif not output_name:
raise ValueError("You must specify an output name to call stop")
if not self.vertex:
raise ValueError("Vertex is not set")
Expand Down

0 comments on commit 99d3227

Please sign in to comment.