(arr)
| 412 | |
| 413 | @normalize_token.register(pa.Array) |
| 414 | def normalize_array(arr): |
| 415 | buffers = arr.buffers() |
| 416 | # pyarrow does something clever when (de)serializing an array that has |
| 417 | # an empty validity map: The buffers for the deserialized array will |
| 418 | # have `None` instead of the empty validity map. |
| 419 | # |
| 420 | # We'll replicate that behavior here to ensure we get consistent |
| 421 | # tokenization. |
| 422 | buffers = arr.buffers() |
| 423 | if len(buffers) and buffers[0] is not None and arr.null_count == 0: |
| 424 | buffers[0] = None |
| 425 | |
| 426 | return ( |
| 427 | "pa.Array", |
| 428 | normalize_token(arr.type), |
| 429 | normalize_token(buffers), |
| 430 | ) |
| 431 | |
| 432 | @normalize_token.register(pa.Buffer) |
| 433 | def normalize_buffer(buf): |
nothing calls this directly
no test coverage detected
searching dependent graphs…