rok commented on code in PR #37533:
URL: https://github.com/apache/arrow/pull/37533#discussion_r1434652460
##########
python/pyarrow/scalar.pxi:
##########
@@ -1027,6 +1027,32 @@ cdef class ExtensionScalar(Scalar):
return pyarrow_wrap_scalar(<shared_ptr[CScalar]> sp_scalar)
+cdef class FixedShapeTensorScalar(ExtensionScalar):
+ """
+ Concrete class for fixed shape tensor extension scalar.
+ """
+
+ def to_numpy_ndarray(self):
+ """
+ Convert fixed shape tensor extension scalar to a numpy.ndarray with
zero copy.
+ """
+ return self.to_tensor().to_numpy()
+
+ def to_tensor(self):
+ """
+ Convert fixed shape tensor extension scalar to a pyarrow.Tensor.
Review Comment:
Thanks for catching that! I must have gotten distracted by
`FixedShapeTensorArray.to_tensor()`. Hopefully done now.
--
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]