Skip to content

Conversation

@damccorm
Copy link
Contributor

@damccorm damccorm commented Oct 3, 2025

As written right now, enabling the GBEK pipeline option doesn't work with CombinePerKey on runners which replace CombinePerKey. This is because CombinePerKey contains a GroupByKey; when runners replace this transform, they will either (a) notice that the transform structure doesn't match what they expect and fail (this is what the Dataflow runner does) or (b) silently replace the new GroupByEncryptedKey with whatever their default implementation is.

In fact, a naive optimized version of GroupByEncryptedKey cannot work at all since encryption happens before handing control to the runner, meaning that combiner lifting can't happen by default. For now, we'll work around this by not doing any lifting of CombinePerKey and using the default implementation, though this could be optimized in the future.

To achieve this, this PR simply doesn't return a URN for CombineValues when GBEK is used. This will cause all runners to use the Beam default implementation.

Example failing test before my changes to CombinePerKey: https://github.com/apache/beam/actions/runs/18232400391/job/51918702360. After my changes, this is succeeding. I'll do the same thing for Java once #36346 is in

Part of #36214


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions github-actions bot added the python label Oct 3, 2025
@damccorm damccorm changed the title [WIP] CombinePerKey with gbek [WIP] CombinePerKey with gbek (Python) Oct 6, 2025
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.21%. Comparing base (6043660) to head (521b6d1).
⚠️ Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
sdks/python/apache_beam/transforms/core.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #36382      +/-   ##
============================================
- Coverage     36.22%   36.21%   -0.01%     
+ Complexity     1667     1666       -1     
============================================
  Files          1058     1058              
  Lines        165088   165213     +125     
  Branches       1190     1190              
============================================
+ Hits          59796    59840      +44     
- Misses       103116   103196      +80     
- Partials       2176     2177       +1     
Flag Coverage Δ
python 40.53% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@damccorm damccorm changed the title [WIP] CombinePerKey with gbek (Python) CombinePerKey with gbek (Python) Oct 6, 2025
@damccorm damccorm marked this pull request as ready for review October 6, 2025 18:13
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

Assigning reviewers:

R: @shunping for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Collaborator

@shunping shunping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@damccorm damccorm merged commit ec35441 into master Oct 7, 2025
140 of 148 checks passed
@damccorm damccorm deleted the users/damccorm/combinePerKey branch October 7, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants