holoviz / datashader

Quickly and accurately render even the largest data.
http://datashader.org
BSD 3-Clause "New" or "Revised" License
3.32k stars 365 forks source link

Better handle returned dask npartitions in tests #1107

Closed ianthomas23 closed 2 years ago

ianthomas23 commented 2 years ago

This is a workaround for issue #1106.

When we request npartitions=2 when converting a pandas to a dask DataFrame, we may receive 1 or 2 partitions depending on the version of dask. Line and area tests using axis=0 have different results depending on the number of partitions as datashader does not cope with npartitions > 1 for these axis=0 situations.

The workaround here is to check the number of partitions in the returned dask.DataFrame to do an appropriate comparison test so that our CI passes regardless of dask version. Our functionality is no more broken than it was before, but users are more likely to be seeing inappropriate results with dask >= 2022.8.