|
39 | 39 | from pandas.errors import PerformanceWarning
|
40 | 40 |
|
41 | 41 | from pandas.core.dtypes.common import is_any_int_dtype
|
| 42 | +from pandas.core.dtypes.dtypes import CategoricalDtypeType |
42 | 43 |
|
43 | 44 | import pandas as pd
|
44 | 45 | import pandas._testing as tm
|
@@ -1543,9 +1544,23 @@ def test_mode_dropna_false_mode_na(data):
|
1543 | 1544 | tm.assert_series_equal(result, expected)
|
1544 | 1545 |
|
1545 | 1546 |
|
1546 |
| -@pytest.mark.parametrize("arrow_dtype", [pa.binary(), pa.binary(16), pa.large_binary()]) |
1547 |
| -def test_arrow_dtype_type(arrow_dtype): |
1548 |
| - assert ArrowDtype(arrow_dtype).type == bytes |
| 1547 | +@pytest.mark.parametrize( |
| 1548 | + "arrow_dtype, expected_type", |
| 1549 | + [ |
| 1550 | + [pa.binary(), bytes], |
| 1551 | + [pa.binary(16), bytes], |
| 1552 | + [pa.large_binary(), bytes], |
| 1553 | + [pa.large_string(), str], |
| 1554 | + [pa.list_(pa.int64()), list], |
| 1555 | + [pa.large_list(pa.int64()), list], |
| 1556 | + [pa.map_(pa.string(), pa.int64()), dict], |
| 1557 | + [pa.dictionary(pa.int64(), pa.int64()), CategoricalDtypeType], |
| 1558 | + ], |
| 1559 | +) |
| 1560 | +def test_arrow_dtype_type(arrow_dtype, expected_type): |
| 1561 | + # GH 51845 |
| 1562 | + # TODO: Redundant with test_getitem_scalar once arrow_dtype exists in data fixture |
| 1563 | + assert ArrowDtype(arrow_dtype).type == expected_type |
1549 | 1564 |
|
1550 | 1565 |
|
1551 | 1566 | def test_is_bool_dtype():
|
@@ -1938,7 +1953,7 @@ def test_str_get(i, exp):
|
1938 | 1953 |
|
1939 | 1954 | @pytest.mark.xfail(
|
1940 | 1955 | reason="TODO: StringMethods._validate should support Arrow list types",
|
1941 |
| - raises=NotImplementedError, |
| 1956 | + raises=AttributeError, |
1942 | 1957 | )
|
1943 | 1958 | def test_str_join():
|
1944 | 1959 | ser = pd.Series(ArrowExtensionArray(pa.array([list("abc"), list("123"), None])))
|
|
0 commit comments