rok commented on code in PR #13454:
URL: https://github.com/apache/arrow/pull/13454#discussion_r914041248
##########
python/pyarrow/types.pxi:
##########
@@ -902,6 +902,18 @@ 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.
+
+ Parameters
+ ----------
+ scalar : pyarrow.ExtensionScalar
+ The scalar to be converted to a Python object.
+ """
+ return scalar.as_py() if scalar is not None else None
Review Comment:
> This should no longer be able to be None right?
>
> Also is the type ExtensionScalar? It seems we pass the underlying value
right?
Scalar shouldn't be None, but the return value could I think. Changed,
please see if it makes sense.
--
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]