| 575 | |
| 576 | |
| 577 | def test_extract_multi_None_raises(dtype) -> None: |
| 578 | pat_str = r"(\w+)_(\d+)" |
| 579 | pat_re = re.compile(pat_str) |
| 580 | |
| 581 | value = xr.DataArray([["a_b"]], dims=["X", "Y"]).astype(dtype) |
| 582 | |
| 583 | with pytest.raises( |
| 584 | ValueError, |
| 585 | match=r"Dimension must be specified if more than one capture group is given.", |
| 586 | ): |
| 587 | value.str.extract(pat=pat_str, dim=None) |
| 588 | |
| 589 | with pytest.raises( |
| 590 | ValueError, |
| 591 | match=r"Dimension must be specified if more than one capture group is given.", |
| 592 | ): |
| 593 | value.str.extract(pat=pat_re, dim=None) |
| 594 | |
| 595 | |
| 596 | def test_extract_extractall_findall_case_re_raises(dtype) -> None: |