kaxil commented on a change in pull request #10227:
URL: https://github.com/apache/airflow/pull/10227#discussion_r467569173



##########
File path: airflow/models/serialized_dag.py
##########
@@ -76,6 +82,7 @@ def __init__(self, dag: DAG):
         self.fileloc_hash = DagCode.dag_fileloc_hash(self.fileloc)
         self.data = SerializedDAG.to_dict(dag)
         self.last_updated = timezone.utcnow()
+        self.dag_hash = hashlib.md5(json.dumps(self.data, 
sort_keys=True).encode("utf-8")).hexdigest()

Review comment:
       The main reason for using Hash of a Serialized DAG is related to the 
question I asked Airbnb folks:
   
   
![image](https://user-images.githubusercontent.com/8811558/89730618-39257000-da38-11ea-828f-076cff27102e.png)
   
   >Question for cong zhu: Do you store Hash of the DAG File? What happens when 
the modules imported by the DAG File changes bu not the DAG files itself, in 
that case DAG file hash remains the same but DAG might not be the same
   >Cong Zhu: Yes, we store the hash of the serialized DAG
   
   




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

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


Reply via email to