Closed martindurant closed 2 months ago
Hmmm still brings up the same problem :-/
These fail because they use the released version of dask-awkward
indeed - I should look at these things after coffee.
Otherwise lgtm.
OK, release is out on pypi and things are importable again.
Something's gone off with with the tests and optimization. One of the awkward histogram filling tests should be using the optimization function from dask awkward as opposed to dask histogram and now it has stopped doing that.
I don't understand. This is a new issue? No code changed here...
Yeah I am not sure, but tests in main are failing.
I'll check on my laptop in a bit.
The tests even passed in your PR so that's rather strange!
https://github.com/dask-contrib/dask-histogram/actions/runs/10946251458/job/30392316434?pr=152#step:5:138 you seem to be right. I have it locally too, must have been a different commit, though.
OK, so the case is: dask is no longer auto-importing dask-awkward as before. If you import dask-awkward before running the graph, it is right. This was the point! dask-histogram uses the existence of "awkward" in the dask config to see whether dak has been imported, and then sets the optimise method. We can use importlib instead.
--- 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
OK?
Fixes #149
This is a more complex way of solving things, by splitting this into two packages.