refactor: Add output_name parameter to stop method in CustomComponent
This commit is contained in:
parent
4eec44e9a8
commit
7f6aebb490
1 changed files with 5 additions and 1 deletions
|
|
@ -91,7 +91,11 @@ class CustomComponent(BaseComponent):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ValueError(f"Error updating state: {e}")
|
raise ValueError(f"Error updating state: {e}")
|
||||||
|
|
||||||
def stop(self, output_name: str):
|
def stop(self, output_name: str | None):
|
||||||
|
if not output_name and len(self.vertex.outputs) == 1:
|
||||||
|
output_name = self.vertex.outputs[0]["name"]
|
||||||
|
else:
|
||||||
|
raise ValueError("You must specify an output name to call stop")
|
||||||
if not self.vertex:
|
if not self.vertex:
|
||||||
raise ValueError("Vertex is not set")
|
raise ValueError("Vertex is not set")
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue