fat-catTW commented on code in PR #71214:
URL: https://github.com/apache/airflow/pull/71214#discussion_r4328145995


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1366,25 +1367,19 @@ def _enqueue_executor_callbacks(self, session: Session) 
-> None:
                     # Can't happen since we queried ExecutorCallback, but 
satisfies mypy.
                     continue
 
-                # TODO: Add dagrun_id as a proper ORM foreign key on the 
callback table instead of storing in data dict.
-                #       This would eliminate this reconstruction step. For 
now, all ExecutorCallbacks
-                #       are expected to have dag_run_id set in their data dict 
(e.g., by Deadline.handle_miss).
-                if not isinstance(callback.data, dict) or "dag_run_id" not in 
callback.data:
-                    self.log.error(
-                        "ExecutorCallback %s is missing required 'dag_run_id' 
in data dict. "
-                        "This indicates a bug in callback creation. Skipping 
callback.",
-                        callback.id,
+                if callback.dagrun_id is None:
+                    self.log.warning(

Review Comment:
   Thanks for the review!
   
   This is not an expected state for an executor callback. The deadline path 
always assigns its DagRun reference.
   It can still occur for a legacy row that cannot be backfilled, or if a 
future callback producer omits the reference. I changed the log from warning to 
error and added a test that asserts the error-level log.



-- 
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