mirror of
https://github.com/wassname/ray.git
synced 2026-08-03 13:10:57 +08:00
switch from submodule to cloning arrow, travis fixes & Robert's comments
This commit is contained in:
@@ -116,10 +116,7 @@ Status SerializeArray(
|
||||
// must be decremented. This is done in SerializeDict in python.cc.
|
||||
PyObject* result = PyObject_CallObject(numbuf_serialize_callback, arglist);
|
||||
Py_XDECREF(arglist);
|
||||
if (!result) {
|
||||
return Status::NotImplemented("python error"); // TODO(pcm):
|
||||
// https://github.com/ray-project/numbuf/issues/10
|
||||
}
|
||||
if (!result) { return Status::NotImplemented("python error"); }
|
||||
builder.AppendDict(PyDict_Size(result));
|
||||
subdicts.push_back(result);
|
||||
}
|
||||
|
||||
@@ -128,10 +128,7 @@ Status append(PyObject* elem, SequenceBuilder& builder, std::vector<PyObject*>&
|
||||
// must be decremented. This is done in SerializeDict in this file.
|
||||
PyObject* result = PyObject_CallObject(numbuf_serialize_callback, arglist);
|
||||
Py_XDECREF(arglist);
|
||||
if (!result) {
|
||||
return Status::NotImplemented("python error"); // TODO(pcm):
|
||||
// https://github.com/ray-project/numbuf/issues/10
|
||||
}
|
||||
if (!result) { return Status::NotImplemented("python error"); }
|
||||
builder.AppendDict(PyDict_Size(result));
|
||||
subdicts.push_back(result);
|
||||
}
|
||||
@@ -285,10 +282,7 @@ Status DeserializeDict(std::shared_ptr<Array> array, int32_t start_idx, int32_t
|
||||
Py_XDECREF(arglist);
|
||||
Py_XDECREF(result);
|
||||
result = callback_result;
|
||||
if (!callback_result) {
|
||||
return Status::NotImplemented("python error"); // TODO(pcm):
|
||||
// https://github.com/ray-project/numbuf/issues/10
|
||||
}
|
||||
if (!callback_result) { return Status::NotImplemented("python error"); }
|
||||
}
|
||||
*out = result;
|
||||
return Status::OK();
|
||||
|
||||
@@ -38,7 +38,7 @@ class SerializationTests(unittest.TestCase):
|
||||
self.roundTripTest([{"hello": [1, 2, 3]}])
|
||||
self.roundTripTest([{"hello": [1, [2, 3]]}])
|
||||
self.roundTripTest([{"hello": (None, 2, [3, 4])}])
|
||||
self.roundTripTest([{"hello": (None, 2, [3, 4], np.ndarray([1.0, 2.0, 3.0]))}])
|
||||
self.roundTripTest([{"hello": (None, 2, [3, 4], np.array([1.0, 2.0, 3.0]))}])
|
||||
|
||||
def numpyTest(self, t):
|
||||
a = np.random.randint(0, 10, size=(100, 100)).astype(t)
|
||||
|
||||
Reference in New Issue
Block a user