Skip to content

Commit

Permalink
sizeof test: increase tolerance (#825)
Browse files Browse the repository at this point in the history
Closes #824 by increasing the tolerance of `sizeof` test of `cudf.DataFrame`.

In the test we clear the `ProxyObject` cache, which makes `sizeof` measure the serialized dataframe. I order to avoid deserializing on every `sizeof` call, we accept this discrepancy between  `sizeof` serialized and deserialized objects.

Authors:
  - Mads R. B. Kristensen (https://github.com/madsbk)

Approvers:
  - Peter Andreas Entschev (https://github.com/pentschev)

URL: #825
  • Loading branch information
madsbk authored Jan 11, 2022
1 parent ec1ec0d commit 172e449
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dask_cuda/tests/test_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ def test_sizeof_cudf():
pxy._pxy_serialize(serializers=("dask",))
assert a_size == pytest.approx(sizeof(pxy))
assert pxy._pxy_get().is_serialized()
# By clearing the cache, `sizeof(pxy)` now measure the serialized data
# thus we have to increase the tolerance.
pxy._pxy_cache = {}
assert a_size == pytest.approx(sizeof(pxy))
assert a_size == pytest.approx(sizeof(pxy), rel=1e-2)
assert pxy._pxy_get().is_serialized()

0 comments on commit 172e449

Please sign in to comment.