(tmp_path: Path)
| 158 | |
| 159 | |
| 160 | def test_col_order(tmp_path: Path): |
| 161 | def _test_order(df: pd.DataFrame): |
| 162 | # process and compare |
| 163 | df1 = process_df(df, copy=True) |
| 164 | assert list(df.columns) == list(df1.columns) |
| 165 | |
| 166 | # convert to arrow and back |
| 167 | df2 = save_load_arrow(tmp_path, df) |
| 168 | assert list(df.columns) == list(df2.columns) |
| 169 | |
| 170 | data = pd.DataFrame( |
| 171 | { |
| 172 | "first_col": [1, 2, 3], |
| 173 | "2nd_col": [1, 2, 3], |
| 174 | "third_col_3": [1, 2, 3], |
| 175 | } |
| 176 | ) |
| 177 | _test_order(data) |
| 178 | |
| 179 | # based on https://github.com/datapane/datapane-hosted/issues/260 |
| 180 | data = pd.DataFrame( |
| 181 | { |
| 182 | "Countries": [1, 2, 3], |
| 183 | "1961": [1, 2, 3], |
| 184 | "1962": [1, 2, 3], |
| 185 | } |
| 186 | ) |
| 187 | _test_order(data) |
| 188 | |
| 189 | |
| 190 | def test_e2e_df_processing(tmp_path: Path): |
nothing calls this directly
no test coverage detected