(index, deep)
| 4129 | @pytest.mark.parametrize("index", [True, False]) |
| 4130 | @pytest.mark.parametrize("deep", [True, False]) |
| 4131 | def test_memory_usage_dataframe(index, deep): |
| 4132 | df = pd.DataFrame( |
| 4133 | {"x": [1, 2, 3], "y": [1.0, 2.0, 3.0], "z": ["a", "b", "c"]}, |
| 4134 | # Dask will use more memory for a multi-partition |
| 4135 | # RangeIndex, so we must set an index explicitly |
| 4136 | index=[1, 2, 3], |
| 4137 | ) |
| 4138 | if pyarrow_strings_enabled(): |
| 4139 | # pandas should measure memory usage of pyarrow strings |
| 4140 | df = to_pyarrow_string(df) |
| 4141 | ddf = dd.from_pandas(df, npartitions=2) |
| 4142 | expected = df.memory_usage(index=index, deep=deep) |
| 4143 | result = ddf.memory_usage(index=index, deep=deep) |
| 4144 | assert_eq(expected, result) |
| 4145 | |
| 4146 | |
| 4147 | @pytest.mark.parametrize("index", [True, False]) |
nothing calls this directly
no test coverage detected