()
| 500 | del b |
| 501 | |
| 502 | def test_tensor_array(): |
| 503 | tensor_type = pa.fixed_shape_tensor(pa.float32(), [2, 3]) |
| 504 | inner = pa.array([float(x) for x in range(1, 7)] + [None] * 12, pa.float32()) |
| 505 | storage = pa.FixedSizeListArray.from_arrays(inner, 6) |
| 506 | f32_array = pa.ExtensionArray.from_storage(tensor_type, storage) |
| 507 | |
| 508 | # Round-tripping as an array gives back storage type, because arrow-rs has |
| 509 | # no notion of extension types. |
| 510 | b = rust.round_trip_array(f32_array) |
| 511 | assert b == f32_array.storage |
| 512 | |
| 513 | batch = pa.record_batch([f32_array], ["tensor"], metadata={b'key1': b'value1'}) |
| 514 | b = rust.round_trip_record_batch(batch) |
| 515 | assert b == batch |
| 516 | assert b.schema == batch.schema |
| 517 | assert b.schema.metadata == batch.schema.metadata |
| 518 | |
| 519 | del b |
| 520 | |
| 521 | |
| 522 | def test_empty_recordbatch_with_row_count(): |
nothing calls this directly
no test coverage detected