Skip to content

fix: bare except at line 180 in pipeline.py#503

Open
saurabhhhcodes wants to merge 1 commit into
UTSAVS26:mainfrom
saurabhhhcodes:fix-pysnippets-batch-2
Open

fix: bare except at line 180 in pipeline.py#503
saurabhhhcodes wants to merge 1 commit into
UTSAVS26:mainfrom
saurabhhhcodes:fix-pysnippets-batch-2

Conversation

@saurabhhhcodes

@saurabhhhcodes saurabhhhcodes commented Jul 20, 2026

Copy link
Copy Markdown

Real bug: bare except: in pysnippets/Scrubs/pipeline.py catches BaseException

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling during data aggregation while preserving existing processing and error tracking behavior.

@github-actions

Copy link
Copy Markdown
Contributor

👋 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!

@github-actions
github-actions Bot requested review from UTSAVS26 and pavitraag July 20, 2026 05:28
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The aggregate_df function now explicitly catches Exception instead of using a bare exception handler. Existing aggregation logic, error tracking, and control flow remain unchanged.

Changes

Aggregate error handling

Layer / File(s) Summary
Explicit exception catch
pysnippets/Scrubs/pipeline.py
aggregate_df catches Exception explicitly while preserving existing error tracking and control flow.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: replacing a bare except in pipeline.py.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9f6eda4 and a33dbc5.

📒 Files selected for processing (1)
  • pysnippets/Scrubs/pipeline.py

})
return pd.concat([s1, s2])
except:
except Exception:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 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

@saurabhhhcodes

Copy link
Copy Markdown
Author

🔔 Friendly ping @UTSAVS26 — this real fix has passing CI and references an approved GSSoC issue. Ready for review/merge. Thanks!

1 similar comment
@saurabhhhcodes

Copy link
Copy Markdown
Author

🔔 Friendly ping @UTSAVS26 — this real fix has passing CI and references an approved GSSoC issue. Ready for review/merge. Thanks!

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.

1 participant