beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From al...@apache.org
Subject [01/11] beam git commit: Remove fn_or_label argument from Map and Filter
Date Sat, 11 Feb 2017 01:00:14 GMT
Repository: beam
Updated Branches:
  refs/heads/master 9a84d3a87 -> af02b8c32


Remove fn_or_label argument from Map and Filter


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/9804a5c2
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/9804a5c2
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/9804a5c2

Branch: refs/heads/master
Commit: 9804a5c2e25f5da8498629c624787b5e5f560af8
Parents: 9a84d3a
Author: Sourabh Bajaj <sourabhbajaj@google.com>
Authored: Wed Feb 8 11:22:42 2017 -0800
Committer: Ahmet Altay <altay@google.com>
Committed: Fri Feb 10 16:59:31 2017 -0800

----------------------------------------------------------------------
 sdks/python/apache_beam/transforms/core.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/9804a5c2/sdks/python/apache_beam/transforms/core.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/transforms/core.py b/sdks/python/apache_beam/transforms/core.py
index eb89344..b678de6 100644
--- a/sdks/python/apache_beam/transforms/core.py
+++ b/sdks/python/apache_beam/transforms/core.py
@@ -737,13 +737,15 @@ def Map(fn, *args, **kwargs):  # pylint: disable=invalid-name
   # Proxy the type-hint information from the original function to this new
   # wrapped function.
   get_type_hints(wrapper).input_types = get_type_hints(fn).input_types
-  output_hint = get_type_hints(fn).simple_output_type(label)
+  output_hint = get_type_hints(fn).simple_output_type(None)
   if output_hint:
     get_type_hints(wrapper).set_output_types(typehints.Iterable[output_hint])
   # pylint: disable=protected-access
   wrapper._argspec_fn = fn
   # pylint: enable=protected-access
 
+  label = 'Map(%s)' % ptransform.label_from_callable(fn)
+
   return FlatMap(label, wrapper, *args, **kwargs)
 
 
@@ -776,7 +778,7 @@ def Filter(fn, *args, **kwargs):  # pylint: disable=invalid-name
   # Proxy the type-hint information from the function being wrapped, setting the
   # output type to be the same as the input type.
   get_type_hints(wrapper).input_types = get_type_hints(fn).input_types
-  output_hint = get_type_hints(fn).simple_output_type(label)
+  output_hint = get_type_hints(fn).simple_output_type(None)
   if (output_hint is None
       and get_type_hints(wrapper).input_types
       and get_type_hints(wrapper).input_types[0]):
@@ -787,6 +789,8 @@ def Filter(fn, *args, **kwargs):  # pylint: disable=invalid-name
   wrapper._argspec_fn = fn
   # pylint: enable=protected-access
 
+  label = 'Filter(%s)' % ptransform.label_from_callable(fn)
+
   return FlatMap(label, wrapper, *args, **kwargs)
 
 


Mime
View raw message