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`?



-- 
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.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to