seanghaeli commented on code in PR #71850:
URL: https://github.com/apache/airflow/pull/71850#discussion_r4067221349


##########
airflow-core/src/airflow/serialization/encoders.py:
##########
@@ -282,6 +283,10 @@ def encode_deadline_reference(ref) -> dict[str, Any]:
 
     serialized = ref.serialize_reference()
 
+    # Added here rather than in serialize_reference() because custom 
references are expected to
+    # override that method, and an override would drop the timing.
+    serialized[EVALUATION_TIMING_FIELD] = getattr(ref, "evaluation_timing", 
DAGRUN_CREATED_TIMING)

Review Comment:
   When upgrading to a new version of airflow with this PR's changes, the new 
key `evaluation_timing` will make every existing alert look changed, so all 
alerts will be deleted and recreated by the dag processor and any queued alarms 
will be orphaned. 
   
   This needs a general fix for deadlines-related code, which I'll get to in a 
separate PR later, but for now, let's make sure this PR doesn't cause that 
problem by changing here:
   
   
https://github.com/apache/airflow/blob/df145d145e3d71d5a75b85a8d5cfbe20f2637979/airflow-core/src/airflow/models/serialized_dag.py#L464-L470
   
   Compare only fields the stored copy has, so adding a new field to the 
serialized format does not register every existing alert as changed.



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