jorisvandenbossche commented on code in PR #34883:
URL: https://github.com/apache/arrow/pull/34883#discussion_r1158186356


##########
python/pyarrow/tests/test_extension_type.py:
##########
@@ -1130,13 +1131,32 @@ def test_cpp_extension_in_python(tmpdir):
 
 
 def test_tensor_type():
-    tensor_type = pa.FixedShapeTensorType(pa.int8(), (2, 3))
+    tensor_type = pa.fixed_shape_tensor(pa.int8(), [2, 3])
     assert tensor_type.extension_name == "arrow.fixed_shape_tensor"
     assert tensor_type.storage_type == pa.list_(pa.int8(), 6)
+    assert tensor_type.shape == [2, 3]
+    assert not tensor_type.dim_names
+    assert not tensor_type.permutation

Review Comment:
   What is the exact return value? (I assume not False, but None or an empty 
list?) 
   If it's an empty list, we should maybe check in the bindings for the 
attribute whether the underlying C++ vector is empty, and in that case return 
None instead? For a python API, that feels nicer to indicate "not defined", and 
also ensures that _if_ it returns a list, it is guaranteed to return a list of 
the same length as `shape`



-- 
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]

Reply via email to