Taragolis commented on code in PR #37540:
URL: https://github.com/apache/airflow/pull/37540#discussion_r1494396180
##########
airflow/configuration.py:
##########
@@ -1883,8 +1889,19 @@ def __getstate__(self):
]
}
- def __setstate__(self, state):
- self.__init__()
+ def __setstate__(self, state) -> None:
+ """
+ Restore the state of the object from a dictionary representation.
+
+ This method is called by the `pickle` module when the object is being
unpickled.
+
+ Args:
+ state (dict): A dictionary containing the state of the object.
+
+ Returns:
+ None
Review Comment:
```suggestion
Args:
state (dict): A dictionary containing the state of the object.
Returns:
None
```
I don't think that this magic method require define parameters in docstring.
Also Airflow project use [reStructuredText Docstring
Format](https://peps.python.org/pep-0287/) and not sure that Google Style
Python Docstrings will render correctly into the documentation.
##########
airflow/configuration.py:
##########
@@ -1871,7 +1871,13 @@ def _warn_deprecate(
stacklevel=4 + extra_stacklevel,
)
- def __getstate__(self):
+ def __getstate__(self) -> dict[str, Any]:
+ """
+ Return the state of the object as a dictionary for pickling.
+
+ Returns:
+ dict: A dictionary containing the state of the object for pickling.
Review Comment:
Same here, if you would like to add returns, just add it in `PEP 287`
format, or just remove it, since it pretty clear what it return from the title
of docstring.
--
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]