[
https://issues.apache.org/jira/browse/BEAM-7021?focusedWorklogId=250290&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-250290
]
ASF GitHub Bot logged work on BEAM-7021:
----------------------------------------
Author: ASF GitHub Bot
Created on: 29/May/19 17:05
Start Date: 29/May/19 17:05
Worklog Time Spent: 10m
Work Description: aaltay commented on pull request #8698: [BEAM-7021]
Added ToString transform on Python SDK
URL: https://github.com/apache/beam/pull/8698#discussion_r288673236
##########
File path: sdks/python/apache_beam/transforms/combiners.py
##########
@@ -924,3 +925,60 @@ def merge_accumulators(self, accumulators):
def extract_output(self, accumulator):
return accumulator[0]
+
+
+class ToString(object):
+ """
+ PTransform for converting a PCollection element, KV or PCollection Iterable
+ to string.
+ """
+
+ class Kvs(ptransform.PTransform):
+ """
+ Transforms each element of the PCollection to a string on the key followed
+ by the specific delimiter and the value.
+ """
+
+ def __init__(self, delimiter=None, **kwargs):
+ self.delimiter = delimiter or ","
+
+ def expand(self, pcoll):
+ input_type = KV[Any, Any]
+ output_type = List[str]
Review comment:
Would not the output type can be just 'str' ? Same for other transforms.
----------------------------------------------------------------
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: 250290)
Time Spent: 1h 40m (was: 1.5h)
> ToString transform for Python SDK
> ---------------------------------
>
> Key: BEAM-7021
> URL: https://issues.apache.org/jira/browse/BEAM-7021
> Project: Beam
> Issue Type: New Feature
> Components: sdk-py-core
> Reporter: Rose Nguyen
> Assignee: Shehzaad Nakhoda
> Priority: Minor
> Labels: starter
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> PTransforms for converting a PCollection or PCollection
> Iterable to a PCollection String
> It should offer the same API as its Java counterpart:
> [https://github.com/apache/beam/blob/11a977b8b26eff2274d706541127c19dc93131a2/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ToString.java]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)