| 3609 | |
| 3610 | |
| 3611 | def test_empty_cast(): |
| 3612 | types = [ |
| 3613 | pa.null(), |
| 3614 | pa.bool_(), |
| 3615 | pa.int8(), |
| 3616 | pa.int16(), |
| 3617 | pa.int32(), |
| 3618 | pa.int64(), |
| 3619 | pa.uint8(), |
| 3620 | pa.uint16(), |
| 3621 | pa.uint32(), |
| 3622 | pa.uint64(), |
| 3623 | pa.float16(), |
| 3624 | pa.float32(), |
| 3625 | pa.float64(), |
| 3626 | pa.date32(), |
| 3627 | pa.date64(), |
| 3628 | pa.binary(), |
| 3629 | pa.binary(length=4), |
| 3630 | pa.string(), |
| 3631 | ] |
| 3632 | |
| 3633 | for (t1, t2) in itertools.product(types, types): |
| 3634 | try: |
| 3635 | # ARROW-4766: Ensure that supported types conversion don't segfault |
| 3636 | # on empty arrays of common types |
| 3637 | pa.array([], type=t1).cast(t2) |
| 3638 | except (pa.lib.ArrowNotImplementedError, pa.ArrowInvalid): |
| 3639 | continue |
| 3640 | |
| 3641 | |
| 3642 | def test_nested_dictionary_array(): |