o-nikolas commented on code in PR #75363:
URL: https://github.com/apache/airflow/pull/75363#discussion_r4734316891


##########
airflow-core/src/airflow/dag_processing/processor.py:
##########
@@ -409,16 +410,22 @@ def _execute_dag_callbacks(dagbag: DagBag, request: 
DagCallbackRequest, log: Fil
                 task_id=ctx_from_server.last_ti.task_id,
             )
         else:
+            ti_context = 
TIRunContext.model_construct(dag_run=ctx_from_server.dag_run, 
max_tries=task.retries)
             runtime_ti = RuntimeTaskInstance.model_construct(
                 **ctx_from_server.last_ti.model_dump(exclude_unset=True),
                 task=task,
-                _ti_context_from_server=TIRunContext.model_construct(
-                    dag_run=ctx_from_server.dag_run,
-                    max_tries=task.retries,
-                ),
+                _ti_context_from_server=ti_context,
             )
-            context = runtime_ti.get_template_context()
+            try:
+                context = runtime_ti.get_template_context()
+            except ParamValidationError:

Review Comment:
   Could the Dag callback change go in its own PR? It touches every Dag 
`on_success_callback`/`on_failure_callback`: when params don't validate they 
now run with unvalidated params (on main they don't run at all), and they get 
`params` even with no `last_ti`. The rest of the PR is only about deadline 
callbacks, the newsfragment doesn't mention it, and it has core import the 
private `_dag_run_params` from the SDK.
   
   ---
   Drafted-by: Kiro (claude-opus-5.5); reviewed by @o-nikolas before posting



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to