Skip to content
Closed
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion python/pyspark/sql/udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ def _create_udf(f, returnType, evalType):
PythonEvalType.SQL_GROUPED_AGG_PANDAS_UDF):

import inspect
import sys
from pyspark.sql.utils import require_minimum_pyarrow_version

require_minimum_pyarrow_version()
argspec = inspect.getargspec(f)

if sys.version_info[0] < 3:
argspec = inspect.getargspec(f)
else:
argspec = inspect.getfullargspec(f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we add a small comment while we are here like 'getargspec ' is deprecated since version 3.0 and calling it with type hints causes an actual issue. See SPARK-23569?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do.


if evalType == PythonEvalType.SQL_SCALAR_PANDAS_UDF and len(argspec.args) == 0 and \
argspec.varargs is None:
Expand Down