Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pysnippets/Scrubs/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def aggregate_df(df, df_y, cols_flags):
'y': conversion_measure
})
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

errors_aggregate_df.append(ckey)
pass

Expand Down