Skip to content

Commit

Permalink
comment explaining hack
Browse files Browse the repository at this point in the history
  • Loading branch information
e-dorigatti committed May 30, 2018
1 parent 8fac2a8 commit 5b5570b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/pyspark/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ def _get_argspec(f):
"""
Get argspec of a function. Supports both Python 2 and Python 3.
"""
# `getargspec` is deprecated since python3.0 (incompatible with function annotations).
# See SPARK-23569.

if hasattr(f, '_argspec'):
# only used for pandas UDF: they wrap the user function, losing its signature
# workers need this signature, so UDF saves it here
argspec = f._argspec
elif sys.version_info[0] < 3:
argspec = inspect.getargspec(f)
else:
# `getargspec` is deprecated since python3.0 (incompatible with function annotations).
# See SPARK-23569.
argspec = inspect.getfullargspec(f)
return argspec

Expand Down

0 comments on commit 5b5570b

Please sign in to comment.