In case anyone else is facing the same issue, this is my quick-n-dirty way to handle it:
import pandas as pd
from mlserver.types import InferenceRequest
def replace_nan_with_none(inference_request: InferenceRequest) -> InferenceRequest:
for i, _input in enumerate(inference_request.inputs):
for ii, v in enumerate(_input.data.__root__):
if pd.isna(v):
inference_request.inputs[i].data.__root__[ii] = None
return inference_request
In case this is a simple fix that could be handled by a newcomer like me, I would be interested to work on the bug fix.
While trying to handle missing values, I've noticed that json serialization is not correct:
serialized request:
In case anyone else is facing the same issue, this is my quick-n-dirty way to handle it:
In case this is a simple fix that could be handled by a newcomer like me, I would be interested to work on the bug fix.