damccorm commented on code in PR #36722:
URL: https://github.com/apache/beam/pull/36722#discussion_r2805660289


##########
sdks/python/apache_beam/transforms/sideinputs_test.py:
##########
@@ -489,6 +491,39 @@ def process(
     assert_that(results, equal_to([(num_records, expected_fingerprint)]))
     pipeline.run()
 
+  def test_default_window_mapping_fn_source_window(self):
+    """Test that the default window mapping function will propagate the
+    source window when attempting to assign context.
+    """
+    class StringIDWindow(window.BoundedWindow):
+      """A window defined by an arbitrary string ID."""
+      def __init__(self, window_id: str):
+        super().__init__(self._getTimestampFromProto())
+        self.id = window_id
+
+      @staticmethod
+      def _getTimestampFromProto() -> Timestamp:
+        return Timestamp(micros=0)
+
+    class StringIDWindows(window.NonMergingWindowFn):
+      """ A windowing function that assigns each element a window with ID."""
+      def assign(
+          self, assign_context: window.WindowFn.AssignContext
+      ) -> Iterable[StringIDWindow]:

Review Comment:
   Would you mind adjusting this type hint? It looks like this is causing 
linting to fail: 
https://github.com/apache/beam/actions/runs/21918758108/job/63292969740?pr=36722
   
   ```
   apache_beam/transforms/sideinputs_test.py:514: error: List item 0 has 
incompatible type "BoundedWindow | None"; expected "StringIDWindow"  [list-item]
   ```



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