harshilv17 opened a new pull request, #41878:
URL: https://github.com/apache/beam/pull/41878
Fixes #19351
`PAssert.thatMap` and `PAssert.thatMultimap` were the only PAssert entry
points still built on a side input: `PCollectionViewAssert` materialized
`View.asMap()` / `View.asMultimap()` and read it in `OneSideInputAssert`. Every
other assertion groups the contents with `GroupThenAssert`.
Changes:
- `PCollectionViewAssert` now takes a function that builds the map from the
grouped contents (`GroupedToMap`, `GroupedToMultimap`) and applies
`GroupThenAssert`, so windowing and pane selection (`inWindow`, `inOnlyPane`,
...) go through the same path as the other asserts.
- Duplicate keys in `thatMap` still fail ("Duplicate values for key ..."),
now as an assertion failure, not a side input error.
- The private `CreateActual` is removed. `OneSideInputAssert` is public, so
it is marked `@Deprecated` instead of removed; it can go in a later release
along with its checks in `TestPipeline` and `countAsserts`.
- CHANGES.md: Deprecations entry.
Tests:
- New in `PAssertTest`: `testThatMap`, `testThatMapNotEqualFails`,
`testThatMapDuplicateKeysFails`, `testThatMultimap`, and
`testThatMapDoesNotUseSideInputs`, which fails on master
(`PAssert$0/CreateActual/View.AsMap/View.CreatePCollectionView`).
- `PAssertTest` passes on the direct runner (needsRunnerTests) and as unit
tests.
- Existing `thatMap`/`thatMultimap` callers pass: `CoGroupByKeyTest`,
`DirectRunnerTest`, the `DataflowRunnerTest` GroupIntoBatches override tests,
and `LeaderBoardTest`.
--
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]