(ser, dser, func, kwargs)
| 75 | ], |
| 76 | ) |
| 77 | def test_string_accessor(ser, dser, func, kwargs): |
| 78 | if pyarrow_strings_enabled(): |
| 79 | ser = ser.astype("string[pyarrow]") |
| 80 | |
| 81 | assert_eq(getattr(ser.str, func)(**kwargs), getattr(dser.str, func)(**kwargs)) |
| 82 | |
| 83 | if func in ( |
| 84 | "contains", |
| 85 | "endswith", |
| 86 | "fullmatch", |
| 87 | "isalnum", |
| 88 | "isalpha", |
| 89 | "isdecimal", |
| 90 | "isdigit", |
| 91 | "islower", |
| 92 | "isspace", |
| 93 | "istitle", |
| 94 | "isupper", |
| 95 | "startswith", |
| 96 | "match", |
| 97 | ): |
| 98 | # This returns arrays and doesn't work in dask/dask either |
| 99 | return |
| 100 | |
| 101 | ser.index = ser.values |
| 102 | ser = ser.sort_index() |
| 103 | dser = from_pandas(ser, npartitions=3) |
| 104 | pdf_result = getattr(ser.index.str, func)(**kwargs) |
| 105 | |
| 106 | if func == "cat" and len(kwargs) > 0: |
| 107 | # Doesn't work with others on Index |
| 108 | return |
| 109 | if isinstance(pdf_result, pd.DataFrame): |
| 110 | assert_eq( |
| 111 | getattr(dser.index.str, func)(**kwargs), pdf_result, check_index=False |
| 112 | ) |
| 113 | else: |
| 114 | assert_eq(getattr(dser.index.str, func)(**kwargs), pdf_result) |
| 115 | |
| 116 | |
| 117 | def test_str_accessor_cat(ser, dser): |
nothing calls this directly
no test coverage detected
searching dependent graphs…