You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes nonpositive worker counts waiting for a worker that was never started. With this, ParallelWorkerPool rejects them immediately with ValueError. This also applies to empty input. The public parallel=0 option still selects the CPU count.
12 focused tests, pre-commit and the CI mypy command passed. The existing early-close worker test was excluded because it also fails on upstream in this environment.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 89b3c47f-6e0e-45ae-949d-bd107905f4b7
📥 Commits
Reviewing files that changed from the base of the PR and between f48af32 and 0220a20.
📒 Files selected for processing: 2
fastembed/parallel_processor.py
tests/test_parallel_processor.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
ParallelWorkerPool.__init__ now raises ValueError when num_workers is zero or negative. Tests cover rejection of zero and negative values, and verify that worker counts of one and two preserve input order in ordered_map and leave pool.processes empty after iteration.
Invalid worker counts now fail with ValueError before worker queues are allocated, while parallel=0 retains automatic CPU selection with a safe fallback. No material merge-blocking issue is established.
Pre-merge checks: 3 · 1 · 1
Failed checks: 1 warning · 1 inconclusive
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check
For #817, ParallelWorkerPool.__init__ raises ValueError for num_workers <= 0 before queue creation. The change also covers empty input because pool construction fails before iteration. Tests cov…
Provide reviewable evidence from the public embedding path or an automated test that parallel=0 resolves to a positive worker count.
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: rejecting nonpositive parallel worker counts.
Description check
The description accurately explains the ValueError behavior, the empty-input case, the public parallel=0 behavior, linked issue, and validation performed.
Out of Scope Changes check
The changes are limited to the #817 validation and focused tests for invalid and positive worker counts. The tests verify error handling, ordered results, and process cleanup. No unrelated change is s…
Full details: Linked Issues check
Explanation
For #817, ParallelWorkerPool.__init__ raises ValueError for num_workers <= 0 before queue creation. The change also covers empty input because pool construction fails before iteration. Tests cover 0, -1, and -2. The available evidence does not establish that the public parallel=0 path still resolves to a positive CPU count.
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes nonpositive worker counts waiting for a worker that was never started. With this, ParallelWorkerPool rejects them immediately with ValueError. This also applies to empty input. The public parallel=0 option still selects the CPU count.
Fixes #817.
12 focused tests, pre-commit and the CI mypy command passed. The existing early-close worker test was excluded because it also fails on upstream in this environment.