Args: buf: the output of `dumps`.
(buf)
| 31 | |
| 32 | @staticmethod |
| 33 | def loads(buf): |
| 34 | """ |
| 35 | Args: |
| 36 | buf: the output of `dumps`. |
| 37 | """ |
| 38 | # Since 0.6, the default max size was set to 1MB. |
| 39 | # We change it to approximately 1G. |
| 40 | return msgpack.loads(buf, raw=False, |
| 41 | max_bin_len=MAX_MSGPACK_LEN, |
| 42 | max_array_len=MAX_MSGPACK_LEN, |
| 43 | max_map_len=MAX_MSGPACK_LEN, |
| 44 | max_str_len=MAX_MSGPACK_LEN) |
| 45 | |
| 46 | |
| 47 | class PyarrowSerializer(object): |