Revert "restore 3.9 compatibility by replacing | with Union[]"

This reverts commit 76bafeb99e.
This commit is contained in:
Lincoln Stein
2023-07-03 10:56:41 -04:00
parent 73a27918c6
commit 2465c7987b
16 changed files with 37 additions and 43 deletions

View File

@ -2,7 +2,6 @@
from abc import ABC
from threading import Event, Thread
from typing import Union
from ..invocations.baseinvocation import InvocationContext
from .graph import Graph, GraphExecutionState
@ -22,7 +21,7 @@ class Invoker:
def invoke(
self, graph_execution_state: GraphExecutionState, invoke_all: bool = False
) -> Union[str, None]:
) -> str | None:
"""Determines the next node to invoke and enqueues it, preparing if needed.
Returns the id of the queued node, or `None` if there are no nodes left to enqueue."""
@ -46,7 +45,7 @@ class Invoker:
return invocation.id
def create_execution_state(self, graph: Union[Graph, None] = None) -> GraphExecutionState:
def create_execution_state(self, graph: Graph | None = None) -> GraphExecutionState:
"""Creates a new execution state for the given graph"""
new_state = GraphExecutionState(graph=Graph() if graph is None else graph)
self.services.graph_execution_manager.set(new_state)