Skip to content

Commit

Permalink
fix: bad dtype definition for dak.num(..., axis=0) metadata (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasdavis authored Nov 15, 2023
1 parent fa07194 commit 40e6b35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dask_awkward/lib/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
DaskAwkwardNotImplemented,
IncompatiblePartitions,
borrow_docstring,
first,
)

if TYPE_CHECKING:
Expand Down Expand Up @@ -595,6 +596,9 @@ def nan_to_num(


def _numaxis0(*integers):
f = first(integers)
if isinstance(f, TypeTracerArray):
return f
return np.sum(np.array(integers))


Expand Down Expand Up @@ -626,7 +630,7 @@ def num(
return new_scalar_object(
hlg,
name,
meta=TypeTracerArray._new(dtype=np.int64, shape=()),
meta=ak.Array(TypeTracerArray._new(dtype=np.dtype("int64"), shape=())),
)
else:
return map_partitions(
Expand Down

0 comments on commit 40e6b35

Please sign in to comment.