()
| 1505 | |
| 1506 | |
| 1507 | def test_take_on_chunked_array(): |
| 1508 | # ARROW-9504 |
| 1509 | arr = pa.chunked_array([ |
| 1510 | [ |
| 1511 | "a", |
| 1512 | "b", |
| 1513 | "c", |
| 1514 | "d", |
| 1515 | "e" |
| 1516 | ], |
| 1517 | [ |
| 1518 | "f", |
| 1519 | "g", |
| 1520 | "h", |
| 1521 | "i", |
| 1522 | "j" |
| 1523 | ] |
| 1524 | ]) |
| 1525 | |
| 1526 | indices = pa.array([0, 5, 1, 6, 9, 2]) |
| 1527 | result = arr.take(indices) |
| 1528 | expected = pa.chunked_array([["a", "f", "b", "g", "j", "c"]]) |
| 1529 | assert result.equals(expected) |
| 1530 | |
| 1531 | indices = pa.chunked_array([[1], [9, 2]]) |
| 1532 | result = arr.take(indices) |
| 1533 | expected = pa.chunked_array([ |
| 1534 | [ |
| 1535 | "b" |
| 1536 | ], |
| 1537 | [ |
| 1538 | "j", |
| 1539 | "c" |
| 1540 | ] |
| 1541 | ]) |
| 1542 | assert result.equals(expected) |
| 1543 | |
| 1544 | |
| 1545 | @pytest.mark.parametrize('ordered', [False, True]) |
nothing calls this directly
no test coverage detected