MLServer icon indicating copy to clipboard operation
MLServer copied to clipboard

Bugfix/Serialize nan and inf as null

Open sp1thas opened this issue 1 year ago • 1 comments

Description

This PR aim to fix this issue #1747 by serializing NaN and Inf values to null

Changes Made

Configure pydantic base model in order to serialize nan and inf as null

Related Issues

Checklist

  • [x] Code follows the project's style guidelines
  • [ ] All tests related to the changes pass successfully
  • [x] Documentation is updated (if necessary)
  • [ ] Code is reviewed by at least one other team member
  • [ ] Any breaking changes are communicated and documented

Additional Notes

sp1thas avatar Aug 28 '24 13:08 sp1thas

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 28 '24 13:08 CLAassistant

@sp1thas Many thanks for your contribution. There are linting issues. Could you take a look please? You can run lint locally using make fmt / make lint

sakoush avatar Sep 05 '24 08:09 sakoush

Hmm, basically I just realised this is already tackled since 1.4.0 and #1346 . I'm closing it. In case a similar approach would make sense for np.inf, let me know and I could prepare a PR based on the current implementation

sp1thas avatar Sep 05 '24 18:09 sp1thas