Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HyukjinKwon committed Jul 13, 2017
1 parent 6d3ef48 commit 2317226
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/pyspark/sql/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,11 @@ def _wrapped(self):
"""
Wrap this udf with a function and attach docstring from func
"""

# It is possible for a callable instance without __name__ attribute to be wrapped here.
# In this case, we should avoid wrapping this attribute from the wrapped function to
# the wrapper function. So, we take out this attribute name from the default names to
# set and then manually assign it after being wrapped.
assignments = tuple(a for a in functools.WRAPPER_ASSIGNMENTS if a != "__name__")

@functools.wraps(self.func, assigned=assignments)
Expand Down

0 comments on commit 2317226

Please sign in to comment.