File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ requires-python = ">=3.9"
57
57
[project .optional-dependencies ]
58
58
dev = [
59
59
" boost_histogram>=0.13" ,
60
- " dask-awkward>=2023 .12.1" ,
60
+ " dask-awkward>=2024 .12.1" ,
61
61
" dask[array,distributed]" ,
62
62
" hist>=1.2" ,
63
63
" pandas" ,
Original file line number Diff line number Diff line change @@ -383,6 +383,8 @@ def _dask_array_from_map(
383
383
** kwargs ,
384
384
):
385
385
dask = uproot .extras .dask ()
386
+ _dask_uses_tasks = hasattr (dask , "_task_spec" )
387
+
386
388
da = uproot .extras .dask_array ()
387
389
if not callable (func ):
388
390
raise ValueError ("`func` argument must be `callable`" )
@@ -446,14 +448,22 @@ def _dask_array_from_map(
446
448
produces_tasks = produces_tasks ,
447
449
)
448
450
449
- dsk = dask .blockwise .Blockwise (
450
- output = name ,
451
- output_indices = "i" ,
452
- dsk = {name : (io_func , dask .blockwise .blockwise_token (0 ))},
453
- indices = [(io_arg_map , "i" )],
454
- numblocks = {},
455
- annotations = None ,
456
- )
451
+ blockwise_kwargs = {
452
+ "output" : name ,
453
+ "output_indices" : "i" ,
454
+ "indices" : [(io_arg_map , "i" )],
455
+ "numblocks" : {},
456
+ "annotations" : None ,
457
+ }
458
+
459
+ if _dask_uses_tasks :
460
+ blockwise_kwargs ["task" ] = dask ._task_spec .Task (
461
+ name , io_func , dask ._task_spec .TaskRef (dask .blockwise .blockwise_token (0 ))
462
+ )
463
+ else :
464
+ blockwise_kwargs ["dsk" ] = {name : (io_func , dask .blockwise .blockwise_token (0 ))}
465
+
466
+ dsk = dask .blockwise .Blockwise (** blockwise_kwargs )
457
467
458
468
hlg = dask .highlevelgraph .HighLevelGraph .from_collections (name , dsk )
459
469
return da .core .Array (hlg , name , chunks , dtype = dtype )
You can’t perform that action at this time.
0 commit comments