fix(backend): BatchProcess.batch_id is required

Providing a `default_factory` is enough for pydantic to know to create the attribute on instantiation if it's not already provided. We can then make make the typing just `str`.
This commit is contained in:
psychedelicious 2023-08-17 11:58:29 +10:00
parent f246b236dd
commit c91621b46c

View File

@ -76,7 +76,7 @@ def uuid_string():
class BatchProcess(BaseModel):
batch_id: Optional[str] = Field(default_factory=uuid_string, description="Identifier for this batch")
batch_id: str = Field(default_factory=uuid_string, description="Identifier for this batch")
batch: Batch = Field(description="List of batch configs to apply to this session")
canceled: bool = Field(description="Flag for saying whether or not to run sessions from this batch", default=False)
graph: Graph = Field(description="The graph being executed")