fix: filter non-float columns in check_for_np_inf#184
Merged
jacobdadams merged 3 commits intomainfrom Feb 17, 2026
Merged
Conversation
Modified check_for_np_inf to only check columns with float dtypes, as np.isinf only works with float types. This prevents TypeError when checking text or other non-numeric columns. Added tests to verify text columns don't cause errors and that the check still works correctly for float columns with inf values. Co-authored-by: jacobdadams <38168030+jacobdadams@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix check_for_np_inf raising error on non-float fields
fix: filter non-float columns in check_for_np_inf
Feb 17, 2026
jacobdadams
approved these changes
Feb 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #184 +/- ##
==========================================
+ Coverage 94.52% 95.69% +1.16%
==========================================
Files 7 7
Lines 1133 1255 +122
Branches 148 148
==========================================
+ Hits 1071 1201 +130
+ Misses 52 44 -8
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jacobdadams
approved these changes
Feb 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes FieldChecker.check_for_np_inf raising TypeError on non-numeric columns by restricting the np.isinf check to float-typed columns, and adds regression coverage for mixed-dtype DataFrames.
Changes:
- Skip non-float columns when scanning for
np.inf/-np.infinFieldChecker.check_for_np_inf. - Add tests ensuring mixed text/int/float DataFrames don’t raise, and still warn when a float column contains
np.inf.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/palletjack/utils.py |
Adds a float-dtype guard before calling np.isinf to prevent errors on text/non-numeric columns. |
tests/test_utils.py |
Adds tests covering mixed-dtype DataFrames and warning behavior for np.inf in float columns. |
stdavis
previously approved these changes
Feb 17, 2026
Member
stdavis
left a comment
There was a problem hiding this comment.
This looks good to me. It's up to you if you want to update the comments as recommended by copilot.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
stdavis
approved these changes
Feb 17, 2026
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.
FieldChecker.check_for_np_infraisesTypeErrorwhen checking text or non-numeric columns becausenp.isinf()only supports float dtypes.Changes
pd.api.types.is_float_dtype()check before callingnp.isinf()to skip non-float columnsExample
Integer and text columns cannot contain
infvalues, so checking only float dtypes is both correct and necessary.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
naciscdn.org/usr/bin/python python -m pytest tests/ -x(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.