jorisvandenbossche commented on a change in pull request #10904:
URL: https://github.com/apache/arrow/pull/10904#discussion_r687467490
##########
File path: python/pyarrow/scalar.pxi
##########
@@ -838,6 +843,67 @@ cdef class UnionScalar(Scalar):
return sp.type_code
+cdef class ExtensionScalar(Scalar):
+ """
+ Concrete class for Extension scalars.
+ """
+
+ @property
+ def value(self):
+ """
+ Return storage value as a scalar.
+ """
+ cdef CExtensionScalar* sp = <CExtensionScalar*> self.wrapped.get()
+ return Scalar.wrap(sp.value) if sp.is_valid else None
+
+ def as_py(self):
+ """
+ Return this scalar as a Python object.
+ """
+ # XXX should there be a hook to wrap the result in a custom class?
Review comment:
Opened https://issues.apache.org/jira/browse/ARROW-13612
--
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]