Skip dask dim transform tests if not available
@@ -6,8 +6,12 @@ from __future__ import division
import numpy as np
import pandas as pd
+
+try:
import dask.dataframe as dd
import dask.array as da
+except:
+ da, dd = None, None
from holoviews.core.data import Dataset
from holoviews.element.comparison import ComparisonTestCase
@@ -28,6 +32,9 @@ class TestDimTransforms(ComparisonTestCase):
['int', 'float', 'negative', 'categories']
)
+ if dd is None:
+ return
+
ddf = dd.from_pandas(self.dataset.data, npartitions=2)
self.dataset_dask = self.dataset.clone(data=ddf)
@@ -43,6 +50,9 @@ class TestDimTransforms(ComparisonTestCase):
expr.apply(self.dataset, keep_index=True), expected
)
+ if dd is None:
+ return
+
# Dask input
self.assertEqual(
expr.apply(self.dataset_dask, keep_index=False), expected
@@ -68,7 +78,7 @@ class TestDimTransforms(ComparisonTestCase):
check_names=False
)
- if skip_dask:
+ if skip_dask or dd is None:
return
# Check using dataset backed by Dask DataFrame
