-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: dask_histogram.factory broken after dask 2024.12 #156
Conversation
just adding a test for now |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
I don't think it's associated with |
I'll check it out in the morning. Not feeling like dealing with a partially documented and changing interface at the moment. |
But thank you for the pointers! |
No worries :) this gets the test to pass: diff --git a/src/dask_histogram/core.py b/src/dask_histogram/core.py
index b80943d..b63823a 100644
--- a/src/dask_histogram/core.py
+++ b/src/dask_histogram/core.py
@@ -1026,6 +1026,7 @@ def _partitioned_histogram(
# Single awkward array object.
if len(data) == 1 and data_is_dak:
from dask_awkward.lib.core import partitionwise_layer as dak_pwl
+ from dask_awkward.layers import _dask_uses_tasks
x = data[0]
if weights is not None and sample is not None:
@@ -1035,7 +1036,9 @@ def _partitioned_histogram(
elif weights is None and sample is not None:
g = dak_pwl(_blocked_dak, name, x, None, sample, histref=histref)
else:
- g = dak_pwl(_blocked_dak, name, x, None, None, histref=histref)
+ import functools
+ ff = functools.partial(_blocked_dak, weights=None, sample=None, histref=histref)
+ g = dak_pwl(ff, name, x)
# Single object, not a dataframe
elif len(data) == 1 and not data_is_df: Looks possible to go around the new interface by just raising the There are some other parts of the test-suite failing. I'll take a swipe at it as well. |
These tests are failing locally for me:
All have to do with dask.dataframe. Probably those are related to the Task spec amd need TaskRef/Aliasing. @lgray if you're OK with it I'd say this is fine to go in to fix the original issue. dask.dataframe things can be dealt with in another PR. |
Thanks! My only nit here is that dak.partitionwise_layer should be taking care of these cases correctly, no? So I think the right way to fix it would be to use TaskRef correctly over in dask-awkward? |
or is this sort-of-currying the function fine? it seems like a requirement on dependent code. |
will merge for now - we'll see if this nitpick crops up later. |
Yeah I think the dak partitionwise layer should be able to handle "broadcasting" the None for all partitions of the actual data-carrying collection. I think in the past Dask was doing this correctly itself, but clearly they've changed things in blockwise. For now we're just creating a higher order function to make sure a None gets used at each node as part of the callable instead of as an argument... the more I think about it the cleaner it seems. |
Fixes #155