| 1520 | ], |
| 1521 | ) |
| 1522 | def test_findall_lookarounds(any_string_dtype, pat, expected_data): |
| 1523 | # https://github.com/pandas-dev/pandas/issues/60833 |
| 1524 | ser = Series(["aa", "ab", "ba", "bb", None], dtype=any_string_dtype) |
| 1525 | result = ser.str.findall(pat) |
| 1526 | if any_string_dtype == "object": |
| 1527 | null_result = None |
| 1528 | elif any_string_dtype == "str": |
| 1529 | null_result = np.nan |
| 1530 | elif any_string_dtype == "string": |
| 1531 | null_result = pd.NA |
| 1532 | else: |
| 1533 | raise ValueError(f"Unrecognized dtype: {any_string_dtype}") |
| 1534 | expected = Series([*expected_data, null_result]) |
| 1535 | tm.assert_series_equal(result, expected) |
| 1536 | |
| 1537 | |
| 1538 | def test_findall_end_of_string(any_string_dtype): |