Joffreybvn commented on code in PR #34964:
URL: https://github.com/apache/airflow/pull/34964#discussion_r1367026145


##########
airflow/models/baseoperator.py:
##########
@@ -1219,14 +1226,10 @@ def __deepcopy__(self, memo):
         return result
 
     def __getstate__(self):
-        state = dict(self.__dict__)
-        del state["_log"]
-
-        return state
+        return dict(self.__dict__)

Review Comment:
   I admit the getstate/setstate part was not very clear to me.
   
   The getstate part is still needed (I assume to not return a logger object in 
a dict that should contains only primitives ?) But is the setstate needed ? 
After being rebuilt, a new `_log` object will be created by the LoggingMixin on 
the first call to `self.log`. Is for consistency ?



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to