Skip to content

Commit

Permalink
Import dak if it's in the system
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Sep 19, 2024
1 parent 9d8fb3e commit e7dd906
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dask_histogram/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7dd906

Please sign in to comment.