Skip to content

Commit

Permalink
feat: improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Oct 11, 2023
1 parent 08be0ec commit e8fff34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/awkward/contents/emptyarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __deepcopy__(self, memo):

def __array__(self, dtype=None):
deprecate(
f"np.asarray(content) is deprecated for {type(self)}. Use ak.to_numpy(content) instead",
f"np.asarray(content) is deprecated for {type(self).__name__}. Use ak.to_numpy(content) instead",
version="2.6.0",
)
return numpy.empty(0, dtype=dtype)
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/numpyarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def __deepcopy__(self, memo):

def __array__(self, dtype=None):
deprecate(
f"np.asarray(content) is deprecated for {type(self)}. Use ak.to_numpy(content) instead",
f"np.asarray(content) is deprecated for {type(self).__name__}. Use ak.to_numpy(content) instead",
version="2.6.0",
)
return numpy.asarray(self._data, dtype=dtype)
Expand Down

0 comments on commit e8fff34

Please sign in to comment.