This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-1-test by this push:
     new 29153818292 [v3-1-test] fix string to datetime pydantic and test 
(#58791) (#58916)
29153818292 is described below

commit 29153818292d05fcb1e1a79af680be2c8d5cce21
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 2 02:00:13 2025 +0100

    [v3-1-test] fix string to datetime pydantic and test (#58791) (#58916)
    
    (cherry picked from commit 43606160c765bd7215e6e814578cc9b8bcbc35fa)
    
    Co-authored-by: Steve Ahn <[email protected]>
---
 task-sdk/src/airflow/sdk/api/client.py     | 2 +-
 task-sdk/tests/task_sdk/api/test_client.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/task-sdk/src/airflow/sdk/api/client.py 
b/task-sdk/src/airflow/sdk/api/client.py
index 1d1db8cfb07..96174734062 100644
--- a/task-sdk/src/airflow/sdk/api/client.py
+++ b/task-sdk/src/airflow/sdk/api/client.py
@@ -283,7 +283,7 @@ class TaskInstanceOperations:
     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,
diff --git a/task-sdk/tests/task_sdk/api/test_client.py 
b/task-sdk/tests/task_sdk/api/test_client.py
index fd52433488a..75f62549747 100644
--- a/task-sdk/tests/task_sdk/api/test_client.py
+++ b/task-sdk/tests/task_sdk/api/test_client.py
@@ -1249,7 +1249,7 @@ class TestTaskRescheduleOperations:
         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:

Reply via email to