MCPcopy Create free account
hub / github.com/datapane/datapane / test_col_order

Function test_col_order

python-client/tests/common/test_df_processor.py:160–187  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

158
159
160def 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
190def test_e2e_df_processing(tmp_path: Path):

Callers

nothing calls this directly

Calls 1

_test_orderFunction · 0.85

Tested by

no test coverage detected