Skip to content

Commit

Permalink
[MON-2260] 'un_numpy' func fix (#2586)
Browse files Browse the repository at this point in the history
* fix

* fix

* fix
  • Loading branch information
yromanyshyn committed Jun 8, 2023
1 parent 0cda40a commit 8cf5507
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deepchecks/utils/dataframes.py
Expand Up @@ -104,6 +104,14 @@ def un_numpy(val):
-------
returns the numpy value in a native type.
"""
if isinstance(val, np.str_):
# NOTE:
# 'np.str_' is instance of the 'np.generic' but
# 'np.isnan(np.str_())' raises an error with a next message:
# >> TypeError: ufunc 'isnan' not supported for the input types...)
#
# therefore this 'if' statement is needed
return val.item()
if isinstance(val, np.generic):
if np.isnan(val):
return None
Expand Down
3 changes: 3 additions & 0 deletions spelling-allowlist.txt
Expand Up @@ -159,3 +159,6 @@ huggingface
tiktoken
ai
idx
isnan
'isnan'
ufunc

0 comments on commit 8cf5507

Please sign in to comment.