fix: bare except at line 180 in pipeline.py#503
Conversation
|
👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly! Feel free to join our community on Discord to discuss more! |
📝 WalkthroughWalkthroughThe ChangesAggregate error handling
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pysnippets/Scrubs/pipeline.py`:
- Line 180: Replace the broad except Exception handler in the pipeline
processing flow with catches for only the expected pandas and data-validation
exception types. Preserve aggregate failure recording for those known validation
errors, while allowing unexpected exceptions to propagate and avoiding Ruff
BLE001.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e4bae1c1-eddd-4a36-adab-bd51d2fe56b4
📒 Files selected for processing (1)
pysnippets/Scrubs/pipeline.py
| }) | ||
| return pd.concat([s1, s2]) | ||
| except: | ||
| except Exception: |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Narrow the exception catch instead of using another blind catch.
Although this no longer catches BaseException, except Exception still suppresses every ordinary application error; unexpected bugs are recorded as aggregate failures and silently omitted. Catch only the expected pandas/data-validation exceptions, and let unexpected failures propagate. Ruff also flags this as BLE001.
🧰 Tools
🪛 Ruff (0.15.21)
[warning] 180-180: Do not catch blind exception: Exception
(BLE001)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pysnippets/Scrubs/pipeline.py` at line 180, Replace the broad except
Exception handler in the pipeline processing flow with catches for only the
expected pandas and data-validation exception types. Preserve aggregate failure
recording for those known validation errors, while allowing unexpected
exceptions to propagate and avoiding Ruff BLE001.
Source: Linters/SAST tools
|
🔔 Friendly ping @UTSAVS26 — this real fix has passing CI and references an approved GSSoC issue. Ready for review/merge. Thanks! |
1 similar comment
|
🔔 Friendly ping @UTSAVS26 — this real fix has passing CI and references an approved GSSoC issue. Ready for review/merge. Thanks! |
Real bug: bare except: in pysnippets/Scrubs/pipeline.py catches BaseException
Summary by CodeRabbit