[ 
https://issues.apache.org/jira/browse/BEAM-6638?focusedWorklogId=199227&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-199227
 ]

ASF GitHub Bot logged work on BEAM-6638:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Feb/19 13:30
            Start Date: 15/Feb/19 13:30
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on pull request #7792: [BEAM-6638] 
Python ExternalTransform output mismatched
URL: https://github.com/apache/beam/pull/7792#discussion_r257231499
 
 

 ##########
 File path: sdks/python/apache_beam/examples/wordcount_xlang.py
 ##########
 @@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""A cross-language word-counting workflow."""
+
+from __future__ import absolute_import
+
+import argparse
+import logging
+import re
+import subprocess
+
+import grpc
+
+import apache_beam as beam
+from apache_beam.io import ReadFromText
+from apache_beam.io import WriteToText
+from apache_beam.options.pipeline_options import PipelineOptions
+from apache_beam.options.pipeline_options import SetupOptions
+
+EXPANSION_SERVICE_PORT = '8097'
+EXPANSION_SERVICE_ADDR = 'localhost:%s' % EXPANSION_SERVICE_PORT
+
+
+class WordExtractingDoFn(beam.DoFn):
+  """Parse each line of input text into words."""
+
+  def process(self, element):
+    """Returns an iterator over the words of this element.
+
+    The element is a line of text.  If the line is blank, note that, too.
+
+    Args:
+      element: the element being processed
+
+    Returns:
+      The processed element.
+    """
+    text_line = element.strip()
+    words = [bytes(x) for x in re.findall(r'[\w\']+', text_line)]
 
 Review comment:
   Add a note as to why bytes is used. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 199227)
    Time Spent: 1h 40m  (was: 1.5h)

> Python ExternalTransform output mismatched
> ------------------------------------------
>
>                 Key: BEAM-6638
>                 URL: https://issues.apache.org/jira/browse/BEAM-6638
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Heejong Lee
>            Assignee: Heejong Lee
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Java PipelineValidator prints out the error that an expanded external 
> transform points to unknown output PCollection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to