You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, including details regarding any error messages, version, and platform.
The implementation of pyarrow.schema doesn't allow objects that are Mappings to take advantage of __arrow_c_schema__ because Mapping is checked before __arrow_c_schema__ is checked.
This seems like a bug considering that custom schema objects naturally fit into the Mapping concept.
Would it make sense to swap the order here and first check for __arrow_c_schema__ and then check whether an object is a mapping?
Component(s)
Python
The text was updated successfully, but these errors were encountered:
ianmcook
changed the title
Mappings that implement __arrow_c_schema__ never have their method invoked
[Python] Mappings that implement __arrow_c_schema__ never have their method invoked
Jul 25, 2024
Good point, thanks for the issue!
I don't think there was a specific reason for this order in the code (added in #37797, cc @wjones127). Will do a PR to switch the order.
…a(..) (#43486)
### Rationale for this change
When converting an object to a pyarrow.Schema with `pa.schema(..)`, first check the capsule interface before checking for mappings. This allows other schema-like objects that expose the capsule interface to also be mappings.
### Are these changes tested?
Yes
* GitHub Issue: #43388
Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Describe the bug, including details regarding any error messages, version, and platform.
The implementation of
pyarrow.schema
doesn't allow objects that areMapping
s to take advantage of__arrow_c_schema__
becauseMapping
is checked before__arrow_c_schema__
is checked.This seems like a bug considering that custom schema objects naturally fit into the
Mapping
concept.Would it make sense to swap the order here and first check for
__arrow_c_schema__
and then check whether an object is a mapping?Component(s)
Python
The text was updated successfully, but these errors were encountered: