Remove unused when values for Interrupt

This commit is contained in:
Nuno Campos
2024-08-22 12:33:25 -07:00
parent a261e1a497
commit f93512e3b3
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -102,5 +102,5 @@ class Send:
@dataclass
class Interrupt:
when: Literal["before", "during", "after"]
value: Any = None
value: Any
when: Literal["during"] = "during"
+1 -1
View File
@@ -40,7 +40,7 @@ class NodeInterrupt(GraphInterrupt):
"""Raised by a node to interrupt execution."""
def __init__(self, value: Any) -> None:
super().__init__([Interrupt("during", value)])
super().__init__([Interrupt(value)])
class EmptyInputError(Exception):
+1 -1
View File
@@ -6383,7 +6383,7 @@ def test_dynamic_interrupt(snapshot: SnapshotAssertion) -> None:
PregelTask(
AnyStr(),
"tool_two",
interrupts=(Interrupt("during", "Just because..."),),
interrupts=(Interrupt("Just because..."),),
),
),
config=tool_two.checkpointer.get_tuple(thread1).config,
+1 -1
View File
@@ -285,7 +285,7 @@ async def test_dynamic_interrupt(
PregelTask(
AnyStr(),
"tool_two",
interrupts=(Interrupt("during", "Just because..."),),
interrupts=(Interrupt("Just because..."),),
),
),
config=tup.config,