Skip to content

Correct pickling error check. - #40597

Merged
jrmccluskey merged 2 commits into
apache:masterfrom
tvalentyn:error_msg
Oct 15, 2026
Merged

jrmccluskey merged 2 commits into
apache:masterfrom
tvalentyn:error_msg

Conversation

@tvalentyn

Copy link
Copy Markdown
Contributor

The e is pickle.PickleError always evaluated to False since e is an instance of an exception.

@github-actions github-actions Bot 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.

📋 Review Summary

This PR fixes a bug in _RunInferenceDoFn._run_inference where e is pickle.PickleError was used instead of isinstance, which always evaluated to False. It introduces a helper _is_pickling_error that checks for pickle.PickleError instances as well as TypeError and AttributeError exceptions containing 'pickle' in their message, accompanied by unit and pipeline tests.

🔍 General Feedback

  • The implementation and unit tests are clean, well-structured, and accurately cover the ways Python's pickle module surfaces pickling failures across process boundaries.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.91%. Comparing base (76f6e6d) to head (9496425).
⚠️ Report is 178 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40597       +/-   ##
=============================================
+ Coverage     56.16%   79.91%   +23.74%     
=============================================
  Files          1124      488      -636     
  Lines        178336    82388    -95948     
  Branches       1489        0     -1489     
=============================================
- Hits         100170    65841    -34329     
+ Misses        75645    16547    -59098     
+ Partials       2521        0     -2521     
Flag Coverage Δ
go ?
java ?
python 79.91% <100.00%> (+0.35%) ⬆️

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.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @jrmccluskey for label python.
Backup reviewer: damccorm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

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).

@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

@jrmccluskey
jrmccluskey merged commit 59e3228 into apache:master Oct 15, 2026
86 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.

2 participants