aboderinsamuel commented on code in PR #50203:
URL: https://github.com/apache/arrow/pull/50203#discussion_r3468257250
##########
python/pyarrow/array.pxi:
##########
@@ -266,6 +266,24 @@ def array(object obj, type=None, mask=None, size=None,
from_pandas=None,
if type is not None and type.id == _Type_EXTENSION:
extension_type = type
type = type.storage_type
+ # GH-49644: when building a fixed_shape_tensor from a sequence of
arrays,
+ # the converter only sees the flat storage type, so validate the
+ # tensor-specific constraints here where the type is still known.
+ if (isinstance(extension_type, FixedShapeTensorType)
+ and isinstance(obj, (list, tuple))):
Review Comment:
Good catch, applied. The validation now triggers for any non-array Sequence
(excluding str/bytes), not just list/tuple, and added a deque test.
--
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]