dask / dask/distributed

Serialization with `"msgpack"` doesn't preserve `list`s

Open
#3,716 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

Currently if a `list` is serialized (and is small enough), it will be handled correctly.

```python
In [1]: from distributed.protocol import serialize, deserialize

In [2]: t = (0, 1, 2)

In [3]: deserialize(*serialize(t, serializers=["msgpack"]))
Out[3]: (0, 1, 2)

In [4]: l = [0, 1, 2]

In [5]: deserialize(*serialize(l, serializers=["msgpack"]))
Out[5]: [0, 1, 2]
```

However for larger `list`s, this breaks down and a `tuple` is returned instead.

```python
In [1]: from distributed.protocol import serialize, deserialize

In [2]: t = (0, 1, 2, 3, 4, 5, 6)

In [3]: deserialize(*serialize(t, serializers=["msgpack"]))
Out[3]: (0, 1, 2, 3, 4, 5, 6)

In [4]: l = [0, 1, 2, 3, 4, 5, 6]

In [5]: deserialize(*serialize(l, serializers=["msgpack"]))
Out[5]: (0, 1, 2, 3, 4, 5, 6)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.