wjones127 commented on code in PR #13454:
URL: https://github.com/apache/arrow/pull/13454#discussion_r910325599
##########
python/pyarrow/types.pxi:
##########
@@ -902,6 +902,19 @@ cdef class ExtensionType(BaseExtensionType):
"""
return ExtensionArray
+ def scalar_as_py(self, scalar):
+ """Convert scalar to a Python type.
+
+ This method can be overridden in subclasses to customize what type
+ scalars are converted to. Implementations should handle the case
+ where the scalar argument is ``None``.
Review Comment:
I think for numpy conversion, we have more efficient methods to do that
conversion (to arrays). I can't think of any other case where someone might
want to customize the null handling of `as_py()`, so maybe you are right that
we should only invoke `scalar_as_py` for existing values.
@jorisvandenbossche Any thoughts on that?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]