feat: stabilize dtype conversion across pandas, pyarrow, and modin test constructors#3749
Merged
camriddell merged 4 commits intoJul 7, 2026
Merged
Conversation
constructors Introduce a shared helper to detect integer-like floats (e.g. 1.0, 2.0) and use it to control pandas' `convert_dtypes(…)` to avoid downcasting floats to integers.
FBruzzesi
approved these changes
Jul 3, 2026
FBruzzesi
left a comment
Member
There was a problem hiding this comment.
Thanks for taking the initiative @camriddell - I have no objections on this! I wonder if the constructors in #3552 should follow the same approach. WDYT?
10 tasks
Member
|
Seems reasonable 🙂 @camriddell have you considered raising an issue in |
Member
Author
Yeah, I think those constructors should take the same approach. |
Member
|
@camriddell I am not sure what's going on with the release drafter 🫥 I would try to merge and see what happens there |
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.
Happy to discuss this. Not converting dtypes is going to be a good thing to test as part of #3717
pandas.{DataFrame,Series}.convert_dtypes(…)will automatically downcast whole number floats (e.g. 1.0, 2.0, 3.0) to integer datatypes. The only option within that method to avoid this behavior is to provideconvert_integer=False, which both: retains the whole number floats columns as a float dtype, but also then ignores any actual integer columns and thus converts themint64.This PR performs each conversion column-by-column and eagerly check for whole number float to control the
convert_integerparameter. I found this to be the least invasive option while still allowing our test suite to continue passing (locally).stabilize dtype conversion across pandas, pyarrow, and modin test constructors
Introduce a shared helper to detect integer-like floats (e.g. 1.0, 2.0) and use it to control pandas'
convert_dtypes(…)to avoid downcasting floats to integers.Description
What type of PR is this? (check all applicable)
Related issues
Checklist