-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
BUG: Assignment of pyarrow arrays yield unexpected dtypes #58601
base: main
Are you sure you want to change the base?
BUG: Assignment of pyarrow arrays yield unexpected dtypes #58601
Conversation
…ssignment-unexpected-dtypes
…ssignment-unexpected-dtypes
pandas/core/frame.py
Outdated
from pandas.compat._constants import REF_COUNT | ||
from pandas.compat._optional import import_optional_dependency | ||
from pandas.compat.numpy import function as nv | ||
|
||
if not pa_version_under11p0: |
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.
What prevents this from working with pyarrow 10?
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.
Nothing prevents it ! :-)
It was a misanderstanding.
At the beginning I thought that the version 11.0.0 was the minimum version (because "Minimum Versions" tests in the CI were not working with pyarrow 10). But actually value
in _sanitize_column
is:
- A
pa.lib.ChunkedArray
in version10.0.1
- A
pa.lib.Array
in versions above
So now I just test ifvalue
is an instance of the parent classpa.lib._PandasConvertible
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.During a column assignment in a
DataFrame
,sanitize_array
is called with adtype
equals toArrowDtype(value.type)
if the columnvalue
is apa.lib._PandasConvertible
(else the standard behaviour is kept)