This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch users/damccorm/breaking
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 05489829fc4c5a7f8f0b103551f9c9b20365e89f
Author: Danny McCormick <dannymccorm...@google.com>
AuthorDate: Wed Oct 2 09:00:28 2024 -0400

    Call out breaking assert_that change more explicitly
---
 CHANGES.md                              | 1 +
 sdks/python/apache_beam/testing/util.py | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index d92639d626b..3d224157e59 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -75,6 +75,7 @@
 
 ## Breaking Changes
 
+* In Python, assert_that now throws if it is not in a pipeline context instead 
of silently succeeding ([#30771](https://github.com/apache/beam/pull/30771))
 * In Python and YAML, ReadFromJson now override the dtype from None to
   an explicit False.  Most notably, string values like `"123"` are preserved
   as strings rather than silently coerced (and possibly truncated) to numeric
diff --git a/sdks/python/apache_beam/testing/util.py 
b/sdks/python/apache_beam/testing/util.py
index f7fabde43d4..8532d1c1f97 100644
--- a/sdks/python/apache_beam/testing/util.py
+++ b/sdks/python/apache_beam/testing/util.py
@@ -266,7 +266,12 @@ def assert_that(
     # 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')
+        'assert_that must be used within a beam.Pipeline context. ' +
+        'Prior to Beam 2.60.0, asserts outside of the context of a pipeline ' +
+        'were silently ignored, starting with Beam 2.60.0 this is no longer ' +
+        'allowed. To fix, move your assert_that call into your pipeline ' +
+        'context so that it is added before the pipeline is run. For more ' +
+        'information, see https://github.com/apache/beam/pull/30771')
 
   # Usually, the uniqueness of the label is left to the pipeline
   # writer to guarantee. Since we're in a testing context, we'll

Reply via email to