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

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

                Author: ASF GitHub Bot
            Created on: 03/May/22 00:24
            Start Date: 03/May/22 00:24
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on code in PR #17384:
URL: https://github.com/apache/beam/pull/17384#discussion_r863276113


##########
sdks/python/apache_beam/utils/windowed_value.pxd:
##########
@@ -43,6 +43,23 @@ cdef class WindowedValue(object):
 
   cpdef WindowedValue with_value(self, new_value)
 
+cdef class WindowedBatch(object):
+  cpdef WindowedBatch with_values(self, object new_values)
+
+cdef class HomogeneousWindowedBatch(WindowedBatch):
+  cdef public WindowedValue _wv

Review Comment:
   Without it the equality checks in windowed_value_test fail, e.g.:
   ```
   __________________________ 
WindowedBatchTest.test_homogeneous_windowed_batch_with_values 
___________________________
   
   self = <apache_beam.utils.windowed_value_test.WindowedBatchTest 
testMethod=test_homogeneous_windowed_batch_with_values>
   
       def test_homogeneous_windowed_batch_with_values(self):
         pane_info = windowed_value.PaneInfo(
             True, True, windowed_value.PaneInfoTiming.ON_TIME, 0, 0)
         wb = windowed_value.HomogeneousWindowedBatch.of(['foo', 'bar'],
                                                         6, (),
                                                         pane_info)
   >     self.assertEqual(
             wb.with_values(['baz', 'foo']),
             windowed_value.HomogeneousWindowedBatch.of(['baz', 'foo'],
                                                        6, (),
                                                        pane_info))
   
   apache_beam/utils/windowed_value_test.py:145: 
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   
   >   return self._wv == other._wv
   E   AttributeError: 'apache_beam.utils.windowed_value.HomogeneousWindow' 
object has no attribute '_wv'
   ```
   
   I'm certainly open to a better solution here. I'm not sure why that's 
happening - is it because of the reference to `other._wv`?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 765233)
    Time Spent: 3h  (was: 2h 50m)

> MVP for SDK worker changes to support process_batch
> ---------------------------------------------------
>
>                 Key: BEAM-14294
>                 URL: https://issues.apache.org/jira/browse/BEAM-14294
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: P2
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> The initial MVP may only work in some restricted circumstances (e.g. 
> @yields_element on process_batch, or batch-to-batch without a 1:1 
> input:output mapping might not be supported). These cases should fail early. 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to