Skip to content

Commit

Permalink
Call out breaking assert_that change more explicitly (#32624)
Browse files Browse the repository at this point in the history
  • Loading branch information
damccorm authored Oct 2, 2024
1 parent 6a09ca9 commit d9ffc23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion sdks/python/apache_beam/testing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9ffc23

Please sign in to comment.