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

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

                Author: ASF GitHub Bot
            Created on: 27/Oct/18 21:09
            Start Date: 27/Oct/18 21:09
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #6844: 
[BEAM-5617] Use bytes consistently for pcollection ids.
URL: https://github.com/apache/beam/pull/6844#discussion_r228726605
 
 

 ##########
 File path: sdks/python/apache_beam/runners/portability/fn_api_runner.py
 ##########
 @@ -1106,16 +1105,16 @@ def extract_endpoints(stage):
                 key=key))
         controller.state_handler.blocking_append(state_key, elements_data)
 
-    def get_buffer(pcoll_id):
-      if (pcoll_id.startswith(b'materialize:')
-          or pcoll_id.startswith(b'timers:')):
-        if pcoll_id not in pcoll_buffers:
+    def get_buffer(buffer_id):
+      kind, name = split_buffer_id(buffer_id)
+      if kind in ('materialize, timers'):
+        if buffer_id not in pcoll_buffers:
           # Just store the data chunks for replay.
-          pcoll_buffers[pcoll_id] = list()
-      elif pcoll_id.startswith(b'group:'):
+          pcoll_buffers[buffer_id] = list()
 
 Review comment:
   pcoll_buffers is keyed by whatever create_buffer_id returns; the fact that 
happens to be bytes isn't something the user should care about. (Well, it's 
bytes to stick it in a payload, but users of pcoll_buffers shouldn't care.)
   
   I'll create a follow-up PR to make pcoll_buffers an ordinary dict which will 
be more robust, but don't have time and the moment and it would be good to 
unblock all these side input issues with Python 3. 

----------------------------------------------------------------
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: 159667)

> Side inputs don't work on Python 3 
> -----------------------------------
>
>                 Key: BEAM-5617
>                 URL: https://issues.apache.org/jira/browse/BEAM-5617
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Valentyn Tymofieiev
>            Assignee: Robert Bradshaw
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> ======================================================================
> ERROR: test_iterable_side_input 
> (apache_beam.transforms.sideinputs_test.SideInputsTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File 
> "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/runners/common.py",
>  line 677, in process
>     self.do_fn_invoker.invoke_process(windowed_value)
>   File 
> "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/runners/common.py",
>  line 414, in invoke_process
>     windowed_value, self.process_method(windowed_value.value))
>   File 
> "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/transforms/core.py",
>  line 1068, in <lambda>
>     wrapper = lambda x: [fn(x)]
>   File 
> "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/testing/util.py",
>  line 119, in _equal
>     'Failed assert: %r == %r' % (sorted_expected, sorted_actual))
> apache_beam.testing.util.BeamAssertException: Failed assert: [3, 4, 6, 8] == 
> []



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

Reply via email to