()
| 274 | |
| 275 | |
| 276 | def test_squeeze(): |
| 277 | df = pd.DataFrame({"x": [1, 3, 6]}) |
| 278 | df2 = pd.DataFrame({"x": [0]}) |
| 279 | s = pd.Series({"test": 0, "b": 100}) |
| 280 | |
| 281 | ddf = from_pandas(df, 3) |
| 282 | ddf2 = from_pandas(df2, 3) |
| 283 | ds = from_pandas(s, 2) |
| 284 | |
| 285 | assert_eq(df.squeeze(), ddf.squeeze()) |
| 286 | assert_eq(pd.Series([0], name="x"), ddf2.squeeze()) |
| 287 | assert_eq(ds.squeeze(), s.squeeze()) |
| 288 | |
| 289 | with pytest.raises( |
| 290 | NotImplementedError, match=f"{type(ddf)} does not support squeeze along axis 0" |
| 291 | ): |
| 292 | ddf.squeeze(axis=0) |
| 293 | |
| 294 | with pytest.raises(ValueError, match=f"No axis {2} for object type {type(ddf)}"): |
| 295 | ddf.squeeze(axis=2) |
| 296 | |
| 297 | with pytest.raises(ValueError, match=f"No axis test for object type {type(ddf)}"): |
| 298 | ddf.squeeze(axis="test") |
| 299 | |
| 300 | |
| 301 | def test_filter_pushdown_reducer_in_predicate(): |
nothing calls this directly
no test coverage detected