clib.converison._to_numpy: Add tests for pandas.Series with pandas numeric dtypes#3584
Merged
clib.converison._to_numpy: Add tests for pandas.Series with pandas numeric dtypes#3584
Conversation
a7054b9 to
c3471cb
Compare
8489ebe to
6f966db
Compare
176f511 to
eceff7f
Compare
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
eceff7f to
6b77f42
Compare
6b77f42 to
7222db2
Compare
Member
Author
|
As explained in the top post, currently this PR does two things:
After finishing this PR, we have two options:
I'm inclined to option 2. |
Member
Yeah, agree to option 2. Keep the unit tests here, and open a separate PR with the code changes from a4f15cd |
seisman
commented
Nov 7, 2024
seisman
commented
Nov 7, 2024
seisman
commented
Nov 28, 2024
michaelgrund
approved these changes
Dec 2, 2024
Member
Author
|
@weiji14 I'm wondering if you have time to give this PR a final review. |
weiji14
approved these changes
Dec 11, 2024
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.
This PR adds tests for pandas.Series with pandas/pyarrow numeric dtypes (in 7222db2).
Tests pass with pandas 2.2 but fail with pandas 2.1. Check https://github.com/GenericMappingTools/pygmt/actions/runs/11714111582/job/32628172796?pr=3584 for details.
The failures are due to upstream pandas v2.2 changes. Previously, all pandas nullable dtypes are converted to np.object_ dtype. Since pandas v2.2, the new rules are (source: https://pandas.pydata.org/docs/whatsnew/v2.2.0.html#to-numpy-for-numpy-nullable-and-arrow-types-converts-to-suitable-numpy-dtype):
Following the first three points, we add the workaround for pandas<2.2 to explicitly specify how to map pandas dtypes into numpy dtypes (a4f15cd). It is an improved version of PR #3505.
Here is the minimal example to understand the behavior change:
With pandas 2.1
With pandas 2.2
Related to #3581, #2848, #3513, #3583.
Wait for #3583.