From c276385ea7222cbe35cb8174c4086b88fc994102 Mon Sep 17 00:00:00 2001 From: Andrii Ieroshenko Date: Thu, 12 Sep 2024 16:28:14 -0700 Subject: [PATCH] make CreateWorkflow.tasks optional --- jupyter_scheduler/workflows.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter_scheduler/workflows.py b/jupyter_scheduler/workflows.py index 3b7707c3..33388c4b 100644 --- a/jupyter_scheduler/workflows.py +++ b/jupyter_scheduler/workflows.py @@ -21,7 +21,7 @@ class WorkflowsHandler(ExtensionHandlerMixin, JobHandlersMixin, APIHandler): @authenticated async def post(self): - payload = self.get_json_body() + payload = self.get_json_body() or {} try: workflow_id = await ensure_async( self.scheduler.create_workflow(CreateWorkflow(**payload)) @@ -160,7 +160,7 @@ async def post(self, workflow_id: str): class CreateWorkflow(BaseModel): - tasks: List[str] + tasks: List[str] = [] class DescribeWorkflow(BaseModel):