-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Series(nullable).tolist() -> numpy scalars #49890
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
Conversation
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.
Could you profile this for pyarrow as well and with NA?
hmm i seem to recall that we very specifically have python scalers in all of these list conversion methods (eg iter as well) i would be surprised this doesn't break many things edit: i think i misread your post |
pyarrow doesn't hit this method. It hits ExtensionArray.tolist. I have a separate PR in the works to make that faster. Here is this PR profiled with NA:
|
Yes, sorry my wording should have been more clear. This makes nullable return python scalars which is consistent with other dtypes |
Thx, missed the file name. good that casting to object is still faster |
Could you merge main? We got some deprecation warnings from numpy that are fixed on main |
[1], | ||
"int64[pyarrow]", | ||
int, | ||
marks=td.skip_if_no("pyarrow", min_version="1.0.0"), |
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 think min version is 7 or something similar, please adjust accordingly
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.
updated to version 6 which is the min version tested, although this test should pass with any version. It looks like there are a handful of other tests that have less than 6.0.
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 think you can get rid of the min version then
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.
ah, thanks. updated
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.
LGTM merge when ready @phofl
thx @lukemanley |
doc/source/whatsnew/v2.0.0.rst
file if fixing a bug or adding a new feature.Series.tolist
documentation states:Nullable dtype behavior seems to be inconsistent with the docstring and other dtypes:
main:
PR:
The fix also provides an improvement in performance: