| 62 | |
| 63 | |
| 64 | class ParamExtType(pa.ExtensionType): |
| 65 | |
| 66 | def __init__(self, width): |
| 67 | self._width = width |
| 68 | super().__init__(pa.binary(width), |
| 69 | "pyarrow.tests.test_cffi.ParamExtType") |
| 70 | |
| 71 | @property |
| 72 | def width(self): |
| 73 | return self._width |
| 74 | |
| 75 | def __arrow_ext_serialize__(self): |
| 76 | return str(self.width).encode() |
| 77 | |
| 78 | @classmethod |
| 79 | def __arrow_ext_deserialize__(cls, storage_type, serialized): |
| 80 | width = int(serialized.decode()) |
| 81 | return cls(width) |
| 82 | |
| 83 | |
| 84 | def make_schema(): |
no outgoing calls