Skip to content

Commit

Permalink
Fix the missing module name of TransformFunctionSerializer.loads
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Mar 5, 2016
1 parent f19228e commit 5f269ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/pyspark/cloudpickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def save_function_tuple(self, func):
save(f_globals)
save(defaults)
save(dct)
save(func.__module__)
write(pickle.TUPLE)
write(pickle.REDUCE) # applies _fill_function on the tuple

Expand Down Expand Up @@ -698,13 +699,14 @@ def _genpartial(func, args, kwds):
return partial(func, *args, **kwds)


def _fill_function(func, globals, defaults, dict):
def _fill_function(func, globals, defaults, dict, module):
""" Fills in the rest of function data into the skeleton function object
that were created via _make_skel_func().
"""
func.__globals__.update(globals)
func.__defaults__ = defaults
func.__dict__ = dict
func.__module__ = module

return func

Expand Down

0 comments on commit 5f269ed

Please sign in to comment.