jrmccluskey commented on code in PR #17733:
URL: https://github.com/apache/beam/pull/17733#discussion_r879678155


##########
sdks/go/pkg/beam/testing/passert/equals.go:
##########
@@ -53,13 +54,37 @@ func EqualsList(s beam.Scope, col beam.PCollection, list 
interface{}) beam.PColl
        return equals(subScope, col, listCollection)
 }
 
+// WindowedEqualsList verifies that the given collection has the same values 
as a
+// given list, under coder equality. The values must be provided as an array 
or a slice.
+// This function also takes a window function to window the list into for 
cases where
+// the PCollections cannot be globally windowed (e.g. tests in unbounded 
pipelines.)
+// This windowing function is applied to both the PCollection created from the 
list
+// and the impulse used to trigger the Diff function.
+func WindowedEqualsList(s beam.Scope, wfn *window.Fn, col beam.PCollection, 
list interface{}) beam.PCollection {

Review Comment:
   I looked at that a little bit and the issue we hit is that in the PAssert 
package level we actually don't have any insight into the windowing of the 
input PCollections. If we could simply pull the windowing information from the 
primary PCollection out, we'd be able to abstract away all of the extra calls 
here. I suppose making global windowing the default would work and we just 
change the underlying equals() function to be what windowedEquals() is now, 
that may work. Let me iterate on it and make sure that approach isn't breaking. 
Either way, the teststream tests needed windowing on the PCollections. 
   
   I'm also alright with making this routing standalone because we will 
eventually want to have robust, streaming-ready passert functions that will 
need to be windowing aware. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to