Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion task-sdk/src/airflow/sdk/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def get_previous_successful_dagrun(self, id: uuid.UUID) -> PrevSuccessfulDagRunR
def get_reschedule_start_date(self, id: uuid.UUID, try_number: int = 1) -> TaskRescheduleStartDate:
"""Get the start date of a task reschedule via the API server."""
resp = self.client.get(f"task-reschedules/{id}/start_date", params={"try_number": try_number})
return TaskRescheduleStartDate.model_construct(start_date=resp.json())
return TaskRescheduleStartDate(start_date=resp.json())

def get_count(
self,
Expand Down
2 changes: 1 addition & 1 deletion task-sdk/tests/task_sdk/api/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ def handle_request(request: httpx.Request) -> httpx.Response:
result = client.task_instances.get_reschedule_start_date(id=ti_id, try_number=1)

assert isinstance(result, TaskRescheduleStartDate)
assert result.start_date == "2024-01-01T00:00:00Z"
assert result.start_date == datetime(2024, 1, 1, 0, 0, 0, tzinfo=timezone.utc)


class TestHITLOperations:
Expand Down