MLServer icon indicating copy to clipboard operation
MLServer copied to clipboard

The `isnan` method doesn't work on Numpy arrays with non-numeric

Open baifachuan opened this issue 6 months ago • 3 comments

My DataFrame has a column with list type, but the value is None, when I use:

tools: list = None
df=pd.Series(
            [
                tools
            ],
            index=[     
                "tools"
            ],
        )
PandasCodec.encode_request(df, use_bytes=False)

Always found this errors if mlserver >= 1.4.0:

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

I found the code:

https://github.com/SeldonIO/MLServer/blob/release/1.4.0/mlserver/codecs/numpy.py#L108

How can I make it work correctly on versions above 1.4.0?

baifachuan avatar Aug 05 '24 12:08 baifachuan