Skip to content

Commit

Permalink
Fixed fill_value for datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
ioanaif committed Feb 18, 2022
1 parent 8c7d990 commit 0e4a6d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/awkward/_v2/operations/structure/ak_full_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def full_like(array, fill_value, highlevel=True, behavior=None, dtype=None):
# In the case of strings and byte strings,
# converting the fill avoids a ValueError.
dtype = np.dtype(dtype)
fill_value = dtype.type(fill_value)
nplike = ak.nplike.of(array)
fill_value = nplike.array([fill_value], dtype=dtype)[0]
# Also, if the fill_value cannot be converted to the dtype
# this should throw a clear, early, error.
if dtype == np.dtype(np.bool_):
Expand Down

0 comments on commit 0e4a6d5

Please sign in to comment.