(obj)
| 543 | pa.schema({'foo': pa.int32()})], |
| 544 | ids=['type', 'field', 'schema']) |
| 545 | def test_roundtrip_schema_capsule(obj): |
| 546 | gc.collect() # Make sure no Arrow data dangles in a ref cycle |
| 547 | old_allocated = pa.total_allocated_bytes() |
| 548 | |
| 549 | capsule = obj.__arrow_c_schema__() |
| 550 | assert PyCapsule_IsValid(capsule, b"arrow_schema") == 1 |
| 551 | assert pa.total_allocated_bytes() > old_allocated |
| 552 | obj_out = type(obj)._import_from_c_capsule(capsule) |
| 553 | assert obj_out == obj |
| 554 | |
| 555 | assert pa.total_allocated_bytes() == old_allocated |
| 556 | |
| 557 | capsule = obj.__arrow_c_schema__() |
| 558 | |
| 559 | assert pa.total_allocated_bytes() > old_allocated |
| 560 | del capsule |
| 561 | assert pa.total_allocated_bytes() == old_allocated |
| 562 | |
| 563 | |
| 564 | @pytest.mark.parametrize('arr,schema_accessor,bad_type,good_type', [ |
nothing calls this directly
no test coverage detected