You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/02 04:36:06 UTC

[GitHub] [airflow] luoyuliuyin commented on a change in pull request #16734: fix: Correctly handle custom deps and task_group during DAG serialization #16690

luoyuliuyin commented on a change in pull request #16734:
URL: https://github.com/apache/airflow/pull/16734#discussion_r662730291



##########
File path: airflow/serialization/serialized_objects.py
##########
@@ -424,7 +424,10 @@ def serialize_operator(cls, op: BaseOperator) -> Dict[str, Any]:
                     )
 
                 deps.append(f'{module_name}.{klass.__name__}')
-            serialize_op['deps'] = deps
+            # deps needs to be sorted here, because op.deps is a set, which is unstable when traversing,
+            # and the same call may get different results.
+            # When calling json.dumps(self.data, sort_keys=True) to generate dag_hash, misjudgment will occur
+            serialize_op['deps'] = sorted(deps)

Review comment:
       Thank you for your comments, I have updated the PR description and title.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org