Skip to content

Commit

Permalink
Add @wraps to the inner function of @ptransform_fn decorator
Browse files Browse the repository at this point in the history
Due to the absence of the @wraps decorator on the inner function,
the metadata about the callable passed(fn.__name__) was not being
updated in the @ptransform_fn decorator.
  • Loading branch information
ttanay committed Feb 21, 2019
1 parent 2cfe7af commit 67e1e25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdks/python/apache_beam/transforms/ptransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class and wrapper class that allows lambda functions to be used as
from builtins import hex
from builtins import object
from builtins import zip
from functools import reduce
from functools import reduce, wraps

from google.protobuf import message

Expand Down Expand Up @@ -854,7 +854,7 @@ def expand(self, pcoll):
(first argument if no label was specified and second argument otherwise).
"""
# TODO(robertwb): Consider removing staticmethod to allow for self parameter.

@wraps(fn)
def callable_ptransform_factory(*args, **kwargs):
return _PTransformFnPTransform(fn, *args, **kwargs)
return callable_ptransform_factory
Expand Down

0 comments on commit 67e1e25

Please sign in to comment.