fix: 2 improvements across 2 files#1016
Closed
tomaioo wants to merge 2 commits into
Closed
Conversation
- Quality: Bare except clauses catching all exceptions silently - Quality: Bare except clause in dask utility module Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Quality: Bare except clauses catching all exceptions silently - Quality: Bare except clause in dask utility module Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Collaborator
|
Hi @tomaioo, welcome to chainladder. The most likely exception for these would be |
Collaborator
|
looks to be a bot |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1016 +/- ##
=======================================
Coverage 89.17% 89.17%
=======================================
Files 89 89
Lines 5165 5165
Branches 661 661
=======================================
Hits 4606 4606
Misses 392 392
Partials 167 167
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Looks like it, @tomaioo, we're going to close this because our spidey senses think you're a bot. Apologies if this is not true, you can submit another PR if you're a human. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
fix: 2 improvements across 2 files
Problem
Severity:
High| File:chainladder/utils/cupy.py:L15Multiple files use bare
except:clauses that catch all exceptions includingKeyboardInterruptandSystemExit, making debugging difficult and potentially masking serious errors. This pattern appears in fallback imports for optional dependencies (cupy, dask, rpy2).Solution
Use
except Exception:instead of bareexcept:to avoid catching system-exiting exceptions. Consider also logging the specific exception that occurred during import failure.Changes
chainladder/utils/cupy.py(modified)chainladder/utils/dask.py(modified)Note
Low Risk
Two-line exception-type tweaks in optional dependency loaders; no change to runtime array logic or public APIs.
Overview
Replaces bare
except:withexcept Exception:in the CuPy and Dask array backend shims (chainladder/utils/cupy.py,chainladder/utils/dask.py).Import-time fallback behavior is unchanged: failed optional imports still fall back to NumPy and warn when the configured
ARRAY_BACKENDexpected that library. The change only stops those blocks from catching system-exiting exceptions such asKeyboardInterruptandSystemExit.Reviewed by Cursor Bugbot for commit 8d82413. Bugbot is set up for automated code reviews on this repo. Configure here.