Permalink
Browse files

Changed map behavior when output fields are given

  • Loading branch information...
1 parent 062b151 commit 87e11b012409c2159d59d1fc8e3de901e3b83184 Gabor Szabo committed Apr 16, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 python/pycascading/operators.py
@@ -57,6 +57,9 @@ def _Map(output_selector, *args):
if isinstance(function, DecoratedFunction):
# By default we take everything from the UDF's decorators
df = function
+ if output_field != Fields.UNKNOWN:
+ # But if we specified the output fields, use that
+ df.decorators['produces'] = output_field
else:
df = udf(produces=output_field)(function)
return Apply(input_selector, df, output_selector)

0 comments on commit 87e11b0

Please sign in to comment.