ashb commented on code in PR #56476:
URL: https://github.com/apache/airflow/pull/56476#discussion_r2417700793


##########
airflow-core/src/airflow/models/serialized_dag.py:
##########
@@ -410,7 +409,14 @@ def write_dag(
                 return False
 
         log.debug("Checking if DAG (%s) changed", dag.dag_id)
+
+         # CRITICAL FIX: Calculate the new deterministic hash first.
+        new_dag_hash = cls.hash(dag.data)
         new_serialized_dag = cls(dag)
+
+        # Overwrite the hash in the new object with the deterministic one for 
comparison.
+        new_serialized_dag.dag_hash = new_dag_hash 

Review Comment:
   Why can't the cls constructor do this itself? Having to remember to do this 
outside seems error prone.



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