()
| 138 | |
| 139 | |
| 140 | def test_to_str(): |
| 141 | data = pd.DataFrame( |
| 142 | dict( |
| 143 | int_col=[x for x in range(32)], |
| 144 | obj_col=[(str(x), str(x)) for x in range(30)] + [pd.NA, pd.NA], |
| 145 | cat_obj_col=[("a", "b") for x in range(30)] + [pd.NA, pd.NA], |
| 146 | ) |
| 147 | ) |
| 148 | |
| 149 | data1 = data.copy(deep=True) |
| 150 | obj_to_str(data1) |
| 151 | _check_is_string(data1, ["obj_col", "cat_obj_col"]) |
| 152 | |
| 153 | data2 = data.copy(deep=True) |
| 154 | parse_categories(data2) |
| 155 | obj_to_str(data2) |
| 156 | _check_is_string(data2, ["obj_col"]) |
| 157 | assert type(data2["cat_obj_col"].cat.categories[0]) == str |
| 158 | |
| 159 | |
| 160 | def test_col_order(tmp_path: Path): |
nothing calls this directly
no test coverage detected