Skip to content

Commit 952d078

Browse files
committed
fixup! Swap from root model to TypeAdapter
1 parent 2bf998a commit 952d078

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

task_sdk/src/airflow/sdk/api/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ def start(self, id: uuid.UUID, pid: int, when: datetime):
9898
"""Tell the API server that this TI has started running."""
9999
body = TIEnterRunningPayload(pid=pid, hostname=get_hostname(), unixname=getuser(), start_date=when)
100100

101-
self.client.patch(f"task-instance/{id}/state", content=self.client.encoder.encode(body))
101+
self.client.patch(f"task-instance/{id}/state", content=body.model_dump_json())
102102

103103
def finish(self, id: uuid.UUID, state: TaskInstanceState, when: datetime):
104104
"""Tell the API server that this TI has reached a terminal state."""
105105
body = TITerminalStatePayload(end_date=when, state=TerminalState(state))
106106

107-
self.client.patch(f"task-instance/{id}/state", content=self.client.encoder.encode(body))
107+
self.client.patch(f"task-instance/{id}/state", content=body.model_dump_json())
108108

109109
def heartbeat(self, id: uuid.UUID):
110110
self.client.put(f"task-instance/{id}/heartbeat")

0 commit comments

Comments
 (0)