[
https://issues.apache.org/jira/browse/BEAM-12357?focusedWorklogId=606122&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-606122
]
ASF GitHub Bot logged work on BEAM-12357:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jun/21 18:49
Start Date: 03/Jun/21 18:49
Worklog Time Spent: 10m
Work Description: aaltay commented on a change in pull request #14869:
URL: https://github.com/apache/beam/pull/14869#discussion_r645046746
##########
File path: sdks/python/apache_beam/transforms/util.py
##########
@@ -51,6 +51,7 @@
from apache_beam.transforms.core import MapTuple
from apache_beam.transforms.core import ParDo
from apache_beam.transforms.core import Windowing
+from apache_beam.transforms.core import _fn_takes_side_inputs
Review comment:
Perhaps we should move `_fn_takes_side_inputs` to util.py now it is used
in multiple places and rename it to `fn_takes_side_inputs`?
##########
File path: sdks/python/apache_beam/transforms/util_test.py
##########
@@ -628,6 +628,17 @@ def test_callable_k(self):
with_keys = pc | util.WithKeys(lambda x: x * x)
assert_that(with_keys, equal_to([(1, 1), (4, 2), (9, 3)]))
+ @staticmethod
+ def _test_args_kwargs_fn(x, multiply, subtract):
+ return x * multiply - subtract
+
+ def test_args_kwargs_k(self):
Review comment:
Could you add a test case with fn that does not take side inputs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 606122)
Time Spent: 1.5h (was: 1h 20m)
> WithKeys transform to take args, kwargs
> ---------------------------------------
>
> Key: BEAM-12357
> URL: https://issues.apache.org/jira/browse/BEAM-12357
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Heidi Hurst
> Assignee: Heidi Hurst
> Priority: P3
> Labels: newbie
> Original Estimate: 1h
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> The current WithKeys implementation for Python precludes the use of functions
> which require additional inputs. An updated version would exhibit the same
> behavior as `beam.Map`, which can receive inputs passed in as
> `beam.Map(some_fn, foo=foo, bar=bar)`.
> (Builds off of https://issues.apache.org/jira/browse/BEAM-7023).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)