Skip to content

Commit a6fdb76

Browse files
committed
make tests work
1 parent fe56c73 commit a6fdb76

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

cpp/src/arrow/python/arrow_to_python.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Status ReadSerializedPythonSequence(std::shared_ptr<io::RandomAccessFile> src,
195195
RETURN_NOT_OK(ipc::RecordBatchStreamReader::Open(src, &reader));
196196
RETURN_NOT_OK(reader->ReadNextRecordBatch(batch_out));
197197
RETURN_NOT_OK(src->Tell(&offset));
198+
offset += 4; // TODO(pcm): Why is this neccessary?
198199
for (int i = 0; i < num_tensors; ++i) {
199200
std::shared_ptr<Tensor> tensor;
200201
RETURN_NOT_OK(ipc::ReadTensor(offset, src.get(), &tensor));

python/pyarrow/tests/test_serialization.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,20 @@ class CustomError(Exception):
168168
pa.lib.register_type(Bar, 20 * b"\x02")
169169
pa.lib.register_type(Baz, 20 * b"\x03")
170170
pa.lib.register_type(Qux, 20 * b"\x04")
171-
pa.lib.register_type(Exception, 20 * b"\x05")
172-
pa.lib.register_type(CustomError, 20 * b"\x06")
173-
pa.lib.register_type(Point, 20 * b"\x07")
174-
pa.lib.register_type(NamedTupleExample, 20 * b"\x08")
171+
pa.lib.register_type(SubQux, 20 * b"\x05")
172+
pa.lib.register_type(Exception, 20 * b"\x06")
173+
pa.lib.register_type(CustomError, 20 * b"\x07")
174+
pa.lib.register_type(Point, 20 * b"\x08")
175+
pa.lib.register_type(NamedTupleExample, 20 * b"\x09")
175176

176177
# TODO(pcm): This is currently a workaround until arrow supports
177178
# arbitrary precision integers. This is only called on long integers,
178179
# see the associated case in the append method in python_to_arrow.cc
179-
pa.lib.register_type(int, 20 * b"\x09", pickle=False,
180+
pa.lib.register_type(int, 20 * b"\x10", pickle=False,
180181
custom_serializer=lambda obj: str(obj),
181182
custom_deserializer=lambda serialized_obj: int(serialized_obj))
182183
if (sys.version_info < (3, 0)):
183-
pa.lib.register_type(long, 20 * b"\x10", pickle=False,
184+
pa.lib.register_type(long, 20 * b"\x11", pickle=False,
184185
custom_serializer=lambda obj: str(obj),
185186
custom_deserializer=lambda serialized_obj: long(serialized_obj))
186187

0 commit comments

Comments
 (0)