-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Python] to_pandas() fails when pandas option 'future.infer_string' is True #45296
Comments
This is related to: It seems the @jorisvandenbossche @WillAyd do we have to check this is specifically for Pandas 3 or should we specialize the call based on pandas 2 vs 3? arrow/python/pyarrow/pandas_compat.py Lines 917 to 925 in 5181c24
|
Yea this is not expected to work with that option in pandas 2.2. The 2.3 release should resolve it |
In the meantime @stephen-a-stc you can either downgrade Arrow to anything less than version 19, or use a development version of pandas with Arrow 19+, and I think you will get the result you are after |
Ah, yes, the current code is assuming that the user only uses the arrow/python/pyarrow/pandas-shim.pxi Lines 182 to 187 in c9f417f
(checking for that option |
Okay, thanks for the information. |
Ah, ok, I wasn't sure this was going to be added to pandas 2.3. @jorisvandenbossche solution makes sense to me for future cases of people using pandas 2.2 and setting I'll add the backport-candidate in case we do a patch release for pyarrow 19 and we can include this. |
Describe the bug, including details regarding any error messages, version, and platform.
Summary
Using the pyarrow table method
to_pandas()
results in an exception ifpandas.set_option('future.infer_string', True)
has been set. This seems related to handling of string data.Environment
Environments: Windows 11, and Linux (docker image "python")
Python versions tested: 3.10, 3.11, 3.12
Python packages:
pyarrow==19.0.0
,pandas==2.2.3
Example
Example's output
Component(s)
Python
The text was updated successfully, but these errors were encountered: