From f2caba648a8a89fda0500d12155041e67214f5be Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Thu, 19 Sep 2024 14:13:27 -0400 Subject: [PATCH] Simpler way (since we're going to import it anyway) --- 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 64d5f19..739c8ce 100644 --- a/src/dask_histogram/core.py +++ b/src/dask_histogram/core.py @@ -526,10 +526,12 @@ def _get_optimization_function(): # detected then the original graph is returned unchanged. import importlib.metadata - if importlib.metadata.distribution("dask_awkward"): + try: from dask_awkward.lib.optimize import all_optimizations return all_optimizations + except (ImportError, ModuleNotFoundError): + pass return optimize