Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/src/arrow/extension/fixed_shape_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ Result<std::shared_ptr<FixedShapeTensorArray>> FixedShapeTensorArray::FromTensor
ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Array> arr,
FixedSizeListArray::FromArrays(value_array, cell_size));
std::shared_ptr<Array> ext_arr = ExtensionType::WrapArray(ext_type, arr);
return std::reinterpret_pointer_cast<FixedShapeTensorArray>(ext_arr);
return std::static_pointer_cast<FixedShapeTensorArray>(ext_arr);
}

const Result<std::shared_ptr<Tensor>> FixedShapeTensorArray::ToTensor() const {
// To convert an array of n dimensional tensors to a n+1 dimensional tensor we
// interpret the array's length as the first dimension the new tensor.

auto ext_arr = internal::checked_pointer_cast<FixedSizeListArray>(this->storage());
auto ext_arr = std::static_pointer_cast<FixedSizeListArray>(this->storage());
auto ext_type = internal::checked_pointer_cast<FixedShapeTensorType>(this->type());
ARROW_RETURN_IF(!is_fixed_width(*ext_arr->value_type()),
Status::Invalid(ext_arr->value_type()->ToString(),
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/extension/fixed_shape_tensor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ TEST_F(TestExtensionType, CreateExtensionType) {
ASSERT_EQ(ext_type_->Serialize(), serialized_);
ASSERT_OK_AND_ASSIGN(auto ds,
ext_type_->Deserialize(ext_type_->storage_type(), serialized_));
auto deserialized = std::reinterpret_pointer_cast<ExtensionType>(ds);
auto deserialized = internal::checked_pointer_cast<ExtensionType>(ds);
ASSERT_TRUE(deserialized->Equals(*ext_type_));

// Test FixedShapeTensorType methods
Expand Down Expand Up @@ -267,7 +267,7 @@ TEST_F(TestExtensionType, CreateFromTensor) {

ASSERT_OK_AND_ASSIGN(auto fsla_arr,
FixedSizeListArray::FromArrays(arr, fixed_size_list(binary(), 2)));
auto ext_arr_5 = std::reinterpret_pointer_cast<FixedShapeTensorArray>(
auto ext_arr_5 = std::static_pointer_cast<FixedShapeTensorArray>(
ExtensionType::WrapArray(ext_type_5, fsla_arr));
EXPECT_RAISES_WITH_MESSAGE_THAT(
Invalid, testing::HasSubstr("binary is not valid data type for a tensor"),
Expand Down