nodes: fix typing of GraphExecutionState.id

This commit is contained in:
Eugene 2023-04-14 00:56:17 -04:00 committed by Eugene Brodsky
parent 7fc5fbd4ce
commit cbd1a7263a
2 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,6 @@
import copy
import itertools
import traceback
import uuid
from types import NoneType
from typing import (
@ -751,7 +750,7 @@ class GraphExecutionState(BaseModel):
"""Tracks the state of a graph execution"""
id: str = Field(
description="The id of the execution state", default_factory=uuid.uuid4
description="The id of the execution state", default_factory=lambda: uuid.uuid4().__str__()
)
# TODO: Store a reference to the graph instead of the actual graph?
@ -1171,7 +1170,7 @@ class LibraryGraph(BaseModel):
if len(v) != len(set(i.alias for i in v)):
raise ValueError("Duplicate exposed alias")
return v
@root_validator
def validate_exposed_nodes(cls, values):
graph = values['graph']

View File

@ -2,12 +2,14 @@
import time
from abc import ABC, abstractmethod
from pydantic import BaseModel, Field
from queue import Queue
from uuid import UUID
from pydantic import BaseModel, Field
class InvocationQueueItem(BaseModel):
graph_execution_state_id: str
graph_execution_state_id: UUID
invocation_id: str
invoke_all: bool
timestamp: float = Field(default_factory=time.time)