Skip to content

chore: update asynchronous_batching.py to use exception in on_error f… - #735

Merged
bednar merged 1 commit into
masterfrom
examples/update_async_batching
Nov 10, 2026
Merged

bednar merged 1 commit into
masterfrom
examples/update_async_batching

Conversation

@karel-rehor

@karel-rehor karel-rehor commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Replace the function passed to on_error in batches.subscribe with done.set_exception so that the exception will be propagated to the controlling Future.

Currently on_error is simply a call to a print function, so when an exception occurs the Future done never properly ends. When this fails in the check-examples job in the CI pipeline it causes the job to hang until the job's timeout is reached (e.g. 10 min).

With this change, if the example fails during the check-examples check, it will fail faster and the underlying cause will be revealed.

Checklist

  • [ ] CHANGELOG.md updated N.A.
  • Rebased/mergeable
  • [ ] A test has been added if appropriate additional tests not needed
  • pytest tests completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@karel-rehor
karel-rehor force-pushed the examples/update_async_batching branch from 7c513f1 to 4581f15 Compare November 6, 2026 16:06
@codecov-commenter

codecov-commenter commented Nov 6, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.54%. Comparing base (1865aca) to head (4581f15).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #735      +/-   ##
==========================================
+ Coverage   90.43%   90.54%   +0.10%     
==========================================
  Files          41       41              
  Lines        3577     3585       +8     
==========================================
+ Hits         3235     3246      +11     
+ Misses        342      339       -3     

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

@bednar
bednar merged commit be9aa4b into master Nov 10, 2026
14 checks passed
@bednar
bednar deleted the examples/update_async_batching branch November 10, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants