Skip to content

[Python] Preserve DaskRunner finish_bundle outputs - #40520

Merged
jrmccluskey merged 1 commit into
apache:masterfrom
Mola-maker:fix/dask-finish-bundle-output
Oct 12, 2026
Merged

jrmccluskey merged 1 commit into
apache:masterfrom
Mola-maker:fix/dask-finish-bundle-output

Conversation

@Mola-maker

Copy link
Copy Markdown
Contributor

DaskRunner snapshots receiver outputs before calling DoFn.finish_bundle(), so a buffering DoFn can complete successfully while emitting an empty collection. Move output collection after invoke_finish_bundle() and before teardown, add regression tests for finish-only and mixed process/finish output, and record the fix in CHANGES.md.

Fixes #40519.

Validation

  • Original code: existing DaskRunner suite 27 passed, 1 xfailed; both new regression tests fail with missing records.
  • Fixed code on fresh workers: full apache_beam/runners/dask/ suite 29 passed, 1 xfailed, 5 subtests passed. The existing expected failure is test_pardo_windowed_side_inputs.
  • Real local execution on Ubuntu x86_64, Python 3.12.14, Beam 2.78.0.dev, Dask/distributed 2026.8.0: two worker processes, two threads per worker, one input partition. Before the fix, the pipeline returned three process records and lost ('finish', 6); afterward all four records match the expected output.
  • Ruff, Yapf formatting check, and git diff --check pass. pip check: No broken requirements found.

The SDK was installed from the editable source checkout with [dask,test,dataframe]. Dependency installation steps and verification commands, installed dependency versions, regression log, and full DaskRunner test log are available at a fixed evidence commit.

Validation used the pure-Python SDK without compiled Cython extensions. Java, cloud runners, and the full multi-language repository suite were not tested. No new project runtime dependency is introduced.

Captured local verification

These screenshots show a read-only local evidence viewer displaying the actual gathered worker outputs and recorded test results. This is a backend runner, so they document execution results rather than an application UI. The evidence files are kept in a separate branch of the fork.

Before fix:

Before fix: successful pipeline loses finish_bundle output

After fix:

After fix: full worker output, passing regressions and consistent dependencies

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @jrmccluskey 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).

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.68%. Comparing base (76f6e6d) to head (637c112).
⚠️ Report is 126 commits behind head on master.

Files with missing lines Patch % Lines
...on/apache_beam/runners/dask/transform_evaluator.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40520       +/-   ##
=============================================
+ Coverage     56.16%   79.68%   +23.51%     
=============================================
  Files          1124      487      -637     
  Lines        178336    82267    -96069     
  Branches       1489        0     -1489     
=============================================
- Hits         100170    65557    -34613     
+ Misses        75645    16710    -58935     
+ Partials       2521        0     -2521     
Flag Coverage Δ
go ?
java ?
python 79.68% <0.00%> (+0.13%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@jrmccluskey jrmccluskey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@jrmccluskey
jrmccluskey merged commit 2a54051 into apache:master Oct 12, 2026
89 of 90 checks passed
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.

[Bug]: DaskRunner silently drops DoFn.finish_bundle outputs

2 participants