throw proper error if numpy array that contains object is serialized

This commit is contained in:
Philipp Moritz
2016-08-08 16:29:59 -07:00
parent 8e165d43d4
commit b6b2b03950
2 changed files with 12 additions and 1 deletions
+5 -1
View File
@@ -1,5 +1,7 @@
#include "numpy.h"
#include <sstream>
#include <numbuf/tensor.h>
using namespace arrow;
@@ -95,7 +97,9 @@ Status SerializeArray(PyArrayObject* array, SequenceBuilder& builder) {
RETURN_NOT_OK(builder.AppendTensor(dims, reinterpret_cast<double*>(data)));
break;
default:
DCHECK(false) << "numpy data type not recognized: " << dtype;
std::stringstream stream;
stream << "numpy data type not recognized: " << dtype;
return Status::NotImplemented(stream.str());
}
Py_XDECREF(contiguous);
return Status::OK();