-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
CLN: Use type_mapper instead of manual conversion #51766
Conversation
pandas/io/parquet.py:253: error: Incompatible types in assignment (expression has type "Type[ArrowDtype]", target has type overloaded function) [assignment] |
thx fixed |
# Incompatible types in assignment (expression has type | ||
# "Type[ArrowDtype]", target has type overloaded function | ||
to_pandas_kwargs["types_mapper"] = pd.ArrowDtype # type: ignore[assignment] # noqa | ||
result = pa_table.to_pandas(**to_pandas_kwargs) |
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 should be able to move the if pandas: .. elif pyarrow: ..
higher up where to_pandas_kwargs["types_mapper"] = ...
is defined. And then just have a single result = pa_table.to_pandas(**to_pandas_kwargs)
here
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.
Avoided this on purpose, because this would chang semantics. The other if is only reached if nullable_dtypes is set as well and I wanted to wait for the other discussion before touching anything,
Good call. I think there are a few more places where we can use type_mapper
|
# Conflicts: # pandas/io/feather_format.py
Updated |
Merging this into 2.0 would have the benefit that we get index support as soon as pyarrow 12 is out |
SGTM |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.