Skip to content

Commit 9cb9a46

Browse files
committed
lint
1 parent 20c866a commit 9cb9a46

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

python/pyarrow/array.pxi

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5190,9 +5190,22 @@ cdef class VariableShapeTensorArray(ExtensionArray):
51905190
values : array-like
51915191
Flat tensor values.
51925192
row_splits : array-like
5193-
Monotonically increasing boundaries into ``values`` with ``row_splits[0] == 0``.
5193+
Monotonically increasing boundaries into ``values`` with
5194+
``row_splits[0] == 0``.
51945195
shapes : array-like
51955196
Physical tensor shapes for each row.
5197+
dim_names : tuple or list of strings, default None
5198+
Explicit names for tensor dimensions.
5199+
permutation : tuple or list of integers, default None
5200+
Physical permutation of tensor dimensions.
5201+
uniform_shape : tuple or list of integers or None, default None
5202+
Optional known uniform dimensions in physical order. If None,
5203+
inferred from shapes.
5204+
value_type : pyarrow.DataType or numpy dtype, default None
5205+
Optional explicit tensor value type. Required when values are
5206+
empty.
5207+
ndim : int, default None
5208+
Optional explicit tensor rank. If None, inferred from shapes.
51965209
"""
51975210
cdef:
51985211
object values_arr
@@ -5298,6 +5311,28 @@ cdef class VariableShapeTensorArray(ExtensionArray):
52985311
uniform_shape=None, value_type=None, ndim=None):
52995312
"""
53005313
Alias for :meth:`from_row_splits`.
5314+
5315+
Parameters
5316+
----------
5317+
values : array-like
5318+
Flat tensor values.
5319+
offsets : array-like
5320+
Monotonically increasing boundaries into ``values`` with
5321+
``offsets[0] == 0``.
5322+
shapes : array-like
5323+
Physical tensor shapes for each row.
5324+
dim_names : tuple or list of strings, default None
5325+
Explicit names for tensor dimensions.
5326+
permutation : tuple or list of integers, default None
5327+
Physical permutation of tensor dimensions.
5328+
uniform_shape : tuple or list of integers or None, default None
5329+
Optional known uniform dimensions in physical order. If None,
5330+
inferred from shapes.
5331+
value_type : pyarrow.DataType or numpy dtype, default None
5332+
Optional explicit tensor value type. Required when values are
5333+
empty.
5334+
ndim : int, default None
5335+
Optional explicit tensor rank. If None, inferred from shapes.
53015336
"""
53025337
return VariableShapeTensorArray.from_row_splits(
53035338
values,

python/pyarrow/tests/test_extension_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ def test_variable_shape_tensor_from_numpy_validation():
18681868
with pytest.raises(TypeError, match=r"obj\[1\] must be a numpy.ndarray"):
18691869
pa.VariableShapeTensorArray.from_numpy_ndarray([arr, [1, 2]])
18701870

1871-
with pytest.raises(ValueError, match="permutation must contain each dimension index"):
1871+
with pytest.raises(ValueError, match="permutation must contain each dimension"):
18721872
pa.VariableShapeTensorArray.from_numpy_ndarray([arr], permutation=[0, 0])
18731873

18741874
with pytest.raises(ValueError, match=r"obj\[0\] has permutation"):

0 commit comments

Comments
 (0)