From f04a7d26d7c1dff91cfa4ab24a04bed2685d1224 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Fri, 30 Nov 2018 14:06:37 -0800 Subject: [PATCH] Fix --- cpp/src/arrow/python/deserialize.cc | 7 ++++--- cpp/src/arrow/python/serialize.cc | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cpp/src/arrow/python/deserialize.cc b/cpp/src/arrow/python/deserialize.cc index f2d50c5b3c7a9..9e4865892fb3e 100644 --- a/cpp/src/arrow/python/deserialize.cc +++ b/cpp/src/arrow/python/deserialize.cc @@ -390,10 +390,11 @@ Status GetSerializedFromComponents(int num_tensors, int num_ndarrays, int num_bu } Status DeserializeNdarray(const SerializedPyObject& object, std::shared_ptr* out) { - if (object.tensors.size() != 1) { - return Status::Invalid("Object is not a Tensor"); + ARROW_LOG(INFO) << "XXX " << object.tensors.size() << " YYY " << object.ndarrays.size(); + if (object.ndarrays.size() != 1) { + return Status::Invalid("Object is not an Ndarray"); } - *out = object.tensors[0]; + *out = object.ndarrays[0]; return Status::OK(); } diff --git a/cpp/src/arrow/python/serialize.cc b/cpp/src/arrow/python/serialize.cc index 4ae7172de8ea5..7911557ee73e0 100644 --- a/cpp/src/arrow/python/serialize.cc +++ b/cpp/src/arrow/python/serialize.cc @@ -755,8 +755,8 @@ Status SerializeObject(PyObject* context, PyObject* sequence, SerializedPyObject Status SerializeNdarray(std::shared_ptr tensor, SerializedPyObject* out) { std::shared_ptr array; SequenceBuilder builder; - RETURN_NOT_OK(builder.AppendNdarray(static_cast(out->tensors.size()))); - out->tensors.push_back(tensor); + RETURN_NOT_OK(builder.AppendNdarray(static_cast(out->ndarrays.size()))); + out->ndarrays.push_back(tensor); RETURN_NOT_OK(builder.Finish(nullptr, nullptr, nullptr, nullptr, &array)); out->batch = MakeBatch(array); return Status::OK();