Fix missing data warning. (#5969)

* Fix data warning.

* Add numpy/scipy test.
This commit is contained in:
Jiaming Yuan
2020-08-05 16:19:12 +08:00
committed by GitHub
parent 8599f87597
commit dde9c5aaff
2 changed files with 27 additions and 3 deletions

View File

@@ -15,10 +15,10 @@ c_bst_ulong = ctypes.c_uint64 # pylint: disable=invalid-name
def _warn_unused_missing(data, missing):
if (not np.isnan(missing)) or (missing is None):
if (missing is not None) and (not np.isnan(missing)):
warnings.warn(
'`missing` is not used for current input data type:' +
str(type(data)))
str(type(data)), UserWarning)
def _check_complex(data):