You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "danepitkin (via GitHub)" <gi...@apache.org> on 2023/06/28 22:04:18 UTC

[GitHub] [arrow] danepitkin commented on a diff in pull request #36314: GH-36096: [Python] Call __from_arrow__ in Array.to_pandas

danepitkin commented on code in PR #36314:
URL: https://github.com/apache/arrow/pull/36314#discussion_r1245832149


##########
python/pyarrow/array.pxi:
##########
@@ -3104,12 +3109,18 @@ cdef class ExtensionArray(Array):
 
     def _to_pandas(self, options, **kwargs):
         pandas_dtype = None
-        try:
-            pandas_dtype = self.type.to_pandas_dtype()
-        except NotImplementedError:
-            pass
+        types_mapper = kwargs.get('types_mapper', None)
+
+        if types_mapper:
+            pandas_dtype = types_mapper(self.type)
+        elif issubclass(type(self.type), ExtensionType):

Review Comment:
   The only difference here now is calling `self.type.to_pandas_dtype()` vs `self.storage.type.to_pandas_dtype()` (storage gets passed to the base Array function). 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org