Skip to content

Commit

Permalink
Asyncify the flow run engine (#16095)
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle authored Nov 22, 2024
1 parent ede23b1 commit d64c0d7
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 118 deletions.
9 changes: 8 additions & 1 deletion src/prefect/client/orchestration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2209,6 +2209,13 @@ async def read_flow_run_states(
response.json()
)

async def set_flow_run_name(self, flow_run_id: UUID, name: str):
flow_run_data = FlowRunUpdate(name=name)
return await self._client.patch(
f"/flow_runs/{flow_run_id}",
json=flow_run_data.model_dump(mode="json", exclude_unset=True),
)

async def set_task_run_name(self, task_run_id: UUID, name: str):
task_run_data = TaskRunUpdate(name=name)
return await self._client.patch(
Expand Down Expand Up @@ -4019,7 +4026,7 @@ def set_flow_run_state(
return OrchestrationResult.model_validate(response.json())

def set_flow_run_name(self, flow_run_id: UUID, name: str):
flow_run_data = TaskRunUpdate(name=name)
flow_run_data = FlowRunUpdate(name=name)
return self._client.patch(
f"/flow_runs/{flow_run_id}",
json=flow_run_data.model_dump(mode="json", exclude_unset=True),
Expand Down
Loading

0 comments on commit d64c0d7

Please sign in to comment.