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/05/13 14:11:46 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #15822: Ensure that task preceeding a PythonVirtualenvOperator doesn't fail

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



##########
File path: airflow/models/dag.py
##########
@@ -1463,13 +1463,8 @@ def partial_subset(
         """
         # deep-copying self.task_dict and self._task_group takes a long time, and we don't want all
         # the tasks anyway, so we copy the tasks manually later
-        task_dict = self.task_dict
-        task_group = self._task_group
-        self.task_dict = {}
-        self._task_group = None  # type: ignore
-        dag = copy.deepcopy(self)
-        self.task_dict = task_dict
-        self._task_group = task_group
+        memo = {id(self.task_dict): None, id(self._task_group): None}
+        dag = copy.deepcopy(self, memo)  # type: ignore

Review comment:
       Just for my sake of understanding, the args passed to `memo` are copied as it is instead of creating new copy of that object?




-- 
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:
users@infra.apache.org