You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "dstandish (via GitHub)" <gi...@apache.org> on 2025/04/17 15:11:32 UTC

[PR] Don't update start_date when resuming a TI from deferral [airflow]

dstandish opened a new pull request, #49407:
URL: https://github.com/apache/airflow/pull/49407

   This allows duration to reflect the overall time from task start to task completion, which is how the metric was calculated in 2.x.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Don't update start_date when resuming a TI from deferral [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on code in PR #49407:
URL: https://github.com/apache/airflow/pull/49407#discussion_r2049183430


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -130,7 +130,8 @@ def ti_run(
 
     # We exclude_unset to avoid updating fields that are not set in the payload
     data = ti_run_payload.model_dump(exclude_unset=True)
-
+    if ti.next_kwargs:
+        data.pop("start_date")

Review Comment:
   yes, just wanted to see if maybe one was already there



##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -130,7 +130,8 @@ def ti_run(
 
     # We exclude_unset to avoid updating fields that are not set in the payload
     data = ti_run_payload.model_dump(exclude_unset=True)
-
+    if ti.next_kwargs:
+        data.pop("start_date")

Review Comment:
   that i could just change
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Don't update start_date when resuming a TI from deferral [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on code in PR #49407:
URL: https://github.com/apache/airflow/pull/49407#discussion_r2049491633


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -130,7 +130,8 @@ def ti_run(
 
     # We exclude_unset to avoid updating fields that are not set in the payload
     data = ti_run_payload.model_dump(exclude_unset=True)
-
+    if ti.next_kwargs:
+        data.pop("start_date")

Review Comment:
   test added



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Don't update start_date when resuming a TI from deferral [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on code in PR #49407:
URL: https://github.com/apache/airflow/pull/49407#discussion_r2049178163


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -130,7 +130,8 @@ def ti_run(
 
     # We exclude_unset to avoid updating fields that are not set in the payload
     data = ti_run_payload.model_dump(exclude_unset=True)
-
+    if ti.next_kwargs:
+        data.pop("start_date")

Review Comment:
   Could you add a test too please



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Don't update start_date when resuming a TI from deferral [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish merged PR #49407:
URL: https://github.com/apache/airflow/pull/49407


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org