Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion python/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
# -- Options for autodoc --------------------------------------------------

# Look at the first line of the docstring for function and method signatures.
autodoc_docstring_signature = True
autosummary_generate = True

# -- Options for HTML output ----------------------------------------------
Expand Down
15 changes: 13 additions & 2 deletions python/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
- :class:`InheritableThread`:
A inheritable thread to use in Spark when the pinned thread mode is on.
"""

import warnings
from functools import wraps
import types
from typing import cast, Any, Callable, Optional, TypeVar, Union
Expand Down Expand Up @@ -76,7 +76,9 @@ def since(version: Union[str, float]) -> Callable[[_F], _F]:
indent_p = re.compile(r"\n( +)")

def deco(f: _F) -> _F:
assert f.__doc__ is not None
if f.__doc__ is None:
# Should still at least add a versionadded.
f.__doc__ = ""

indents = indent_p.findall(f.__doc__)
indent = " " * (min(len(m) for m in indents) if indents else 0)
Expand Down Expand Up @@ -121,10 +123,19 @@ def keyword_only(func: _F) -> _F:
A decorator that forces keyword arguments in the wrapped method
and saves actual input keyword arguments in `_input_kwargs`.

.. deprecated:: 4.0.0
`keyword_only` method is deprecated. Use the standard
keyword-only syntax in Python instead.

Notes
-----
Should only be used to wrap a method where first arg is `self`
"""
warnings.warn(
"keyword_only method is deprecated. Use the standard keyword-only"
"syntax in Python instead.",
FutureWarning,
)

@wraps(func)
def wrapper(self: Any, *args: Any, **kwargs: Any) -> Any:
Expand Down
Loading