refactor: replace cast() with isinstance assertions in reports - #1218
Closed
ovodela wants to merge 1 commit into
Closed
refactor: replace cast() with isinstance assertions in reports#1218ovodela wants to merge 1 commit into
ovodela wants to merge 1 commit into
Conversation
Replace cast() calls with assert isinstance() checks where the type narrowing serves to access subclass attributes. This provides both static type safety and runtime validation instead of unchecked casts. The cast(F, new_f) in utils.py is retained as it handles a fundamental typing limitation with decorator return types that cannot be expressed with isinstance. Addresses capitalone#720
Author
|
Closing this PR — re-submitting through the Capital One Spork contribution pipeline (via capitalone-contributions fork) for proper compliance. Same changes will be in the new PR. |
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
Changes
Test plan
Addresses #720