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