-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
(fix): no fill_value
on reindex
#10304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ilan-gold
wants to merge
19
commits into
pydata:main
Choose a base branch
from
ilan-gold:ig/fix_no_fill_value
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e19fe33
(fix): no `fill_value` on reindex
ilan-gold 05f37f6
(chore): add `fillna` tests
ilan-gold 137c4ab
(fix): arbitrary captialization
ilan-gold 3b499cf
(chore): add interval array explicitly checked
ilan-gold 4920782
(fix): ds values errors + `dropna` tests
ilan-gold 6c97217
(fix): mypy
ilan-gold c561e4e
(fix): add in `reshape` implemented + remove integer tests
ilan-gold 29131c2
(fix): add different test cases for fillna + dropna
ilan-gold cf11804
(fix): `dataset` tests + marks for pyarrow
ilan-gold a7ab018
(fix): remove error for 1d arrays
ilan-gold 4a2170a
(fix): test deps for min versions
ilan-gold cdedf04
(fix): function name
ilan-gold 651152d
(fix): `ignore` comment mypy
ilan-gold f168040
(fix): explicit skipped line
ilan-gold 710404d
(fix): repr test
ilan-gold 62aa485
(fix): add copy + deepcopy
ilan-gold f7758ca
Merge branch 'main' into ig/fix_no_fill_value
ilan-gold 4c66e3e
Merge branch 'main' into ig/fix_no_fill_value
ilan-gold 93ab2a8
Merge branch 'main' into ig/fix_no_fill_value
ilan-gold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we aren't ready to support these yet. Can we instead autoconvert anything with
pd.NA
tofloat
and convert to the numpy dtype otherwise?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcherian I think we should keep the two issues separate. It sounds like @richard-berg will have a PR that cleans this behavior up (i.e., convert float/int/string types from
NumpyExtensionArray
, maintain the rest or something close). For now I would change the tests so that his life is easier, but at the end of the day, I think this PR is needed regardless since there is nothing specifically referencing numeric/string types. You can reproduce the issue in #10301 with any kind of extension array type:If @richard-berg does not get permission to handle this sort of thing, I can make a PR and hopefully he can review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a small fix here to use arrow types as the "other" extension array type to ensure some level of better coverage, which indeed revealed a small bug. I will update the reindexing tests as well to use them.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two fixes:
reshape
function registered so it was falling back tonumpy
which was problematic forrepr
once it was added here becauserepr
didn't know about extension arrays. That has been resolved.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue is a lot deeper than I realized: pandas-dev/pandas#61433, actually for the indexing issue with
arrow
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, it looks like this doesn't have an impact here, as it turns out. It still seems like we're getting away with murder a bit because it is possible to yield 0-dimensional arrow arrays from some data types and not others. When it is possible, that gels with what xarray expects, but when it's not possible, we have problems. We probably need to look into a solution for this. Maybe making
__getitem__
polymorphic, but fixing this issue + adding the test cases opened up a few different cans of worms here, so I will be able to track that issue and then can work on a fix here separately.The broken test is similarly related to unexpected behavior around
arrow
dtypes again...will look into that as well