Copilot commented on code in PR #51159:
URL: https://github.com/apache/arrow/pull/51159#discussion_r3934157687
##########
python/pyarrow/array.pxi:
##########
@@ -2269,7 +2269,7 @@ cdef class Array(_PandasConvertible):
return pyarrow_wrap_array(array)
- def __dlpack__(self, stream=None, max_version=None, dl_device=None,
copy=None):
+ def __dlpack__(self, *, stream=None, max_version=None, dl_device=None,
copy=None):
Review Comment:
Changing Array.__dlpack__ to keyword-only (adding `*`) is a
backward-incompatible Python API change for callers that may have been passing
positional arguments. If the intent is spec conformance, consider a deprecation
path; otherwise keep the previous signature to preserve compatibility.
##########
python/pyarrow/scalar.pxi:
##########
@@ -1586,6 +1586,35 @@ cdef class FixedShapeTensorScalar(ExtensionScalar):
ctensor = GetResultValue(c_type.MakeTensor(scalar))
return pyarrow_wrap_tensor(ctensor)
+ def __dlpack__(self, *, stream=None, max_version=None, dl_device=None,
copy=None):
+ """
+ Export a tensor array as a DLPack capsule.
+
+ See :meth:`Tensor.__dlpack__` for the parameter semantics.
+ """
Review Comment:
The new FixedShapeTensorScalar.__dlpack__ docstring says it exports a
"tensor array"; this is a scalar method, so the wording is misleading for API
docs/users.
--
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]