robertwb commented on code in PR #30771:
URL: https://github.com/apache/beam/pull/30771#discussion_r1552178049


##########
sdks/python/apache_beam/testing/util.py:
##########
@@ -261,6 +261,19 @@ def assert_that(
   """
   assert isinstance(actual, pvalue.PCollection), (
       '%s is not a supported type for Beam assert' % type(actual))
+  pipeline = actual.pipeline
+  if getattr(pipeline, 'result', None) is not None:
+    # The pipeline was already run. The user most likely called assert_that
+    # after the pipeleline context.
+    raise RuntimeError(
+        'assert_that must be used within a beam.Pipeline context')
+
+  # If label is already in use, just append a number to it.

Review Comment:
   Maybe add something about not needing stability of names across pipeline 
update in a testing context?



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