Prepare migration to pandas 3.0 - #3360
Merged
Merged
Conversation
Collaborator
Author
|
edit: @C-Achard, I have changed the scope of this PR to small preparatory fixes. The whole pandas migration to 3.0 will entail more work than I initially estimated. This PR flags just a few examples and adds a useful tool for CI if we decide to push forward with this. We might re-consider if the whole migration will be worth it in the first-place. Pandas 3.0 is relatively new and I doubt that users will rely on it soon, so I think we may be save with restricting to 2.x for the time being, until we eventually refactor the keypoint/dataset management in its entirety. See also tracking issue #3362 |
deruyter92
marked this pull request as ready for review
June 10, 2026 09:52
C-Achard
reviewed
Jun 10, 2026
C-Achard
approved these changes
Jun 10, 2026
C-Achard
reviewed
Jun 10, 2026
Collaborator
|
(Note: trying to fix current CI issues seen here in #3363 ) |
Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>
Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>
Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>
Collaborator
Author
|
@C-Achard Thanks for the review. Good points, I've applied all your suggestions. |
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.
Pandas released version 3.0 in Jan 2026 which introduces breaking changes for our codebase. It would be useful to address the places where it currently breaks, so we can remove the upperbound version we introduced in #3186. See the full tracking issue #3362, for an overview of related PRs.
Small fixes and flagged patterns:
As exploratory preparation, this PR implements small fixes in preparation to 3.0 migration. Also it flags breaking instances based on a targeted search for these patterns:
.locassignment (copy on write; CoW) -> mutate parent object directly instead of a subset viewselect_dtypes(include="object")-> string type migrationfuture.no_silent_downcastingFuture mode testing:
Also this PR adds a new tool for CI or local testing, using the pandas 2.3 future options that warns for CoW patterns and detects where
strtype should be included instead of onlyobject.