From e7dd906b8c263bc39183f02d56a9ca81f774119c Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Thu, 19 Sep 2024 14:10:25 -0400 Subject: [PATCH] Import dak if it's in the system --- src/dask_histogram/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dask_histogram/core.py b/src/dask_histogram/core.py index 4f3cec7..64d5f19 100644 --- a/src/dask_histogram/core.py +++ b/src/dask_histogram/core.py @@ -524,7 +524,9 @@ def _get_optimization_function(): # running this optimization even in cases where it's unncessary # because if no AwkwardInputLayers from dask-awkward are # detected then the original graph is returned unchanged. - if dask.config.get("awkward", default=False): + import importlib.metadata + + if importlib.metadata.distribution("dask_awkward"): from dask_awkward.lib.optimize import all_optimizations return all_optimizations