uranusjr commented on code in PR #34964:
URL: https://github.com/apache/airflow/pull/34964#discussion_r1369637078
##########
airflow/models/baseoperator.py:
##########
@@ -1218,15 +1225,17 @@ def __deepcopy__(self, memo):
result.__instantiated = self.__instantiated
return result
- def __getstate__(self):
+ def __getstate__(self) -> dict:
state = dict(self.__dict__)
- del state["_log"]
+ state["_log"] = self._log.name if self._log else None
Review Comment:
I don’t think we need to record `_log.name` at all? It is easily
reconstructable from `_log_config_logger_name` and `_logger_name`.
##########
airflow/models/baseoperator.py:
##########
@@ -1218,15 +1225,17 @@ def __deepcopy__(self, memo):
result.__instantiated = self.__instantiated
return result
- def __getstate__(self):
+ def __getstate__(self) -> dict:
state = dict(self.__dict__)
- del state["_log"]
+ state["_log"] = self._log.name if self._log else None
Review Comment:
I don’t think we need to record `_log.name` at all? It is easily
reconstructable from `_log_config_logger_name` and `_logger_name`.
--
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]