Skip to content

Bugfix/Serialize nan and inf as null#1893

Closed
sp1thas wants to merge 2 commits into
SeldonIO:masterfrom
sp1thas:feature/nan-inf-pydantic-serialization
Closed

Bugfix/Serialize nan and inf as null#1893
sp1thas wants to merge 2 commits into
SeldonIO:masterfrom
sp1thas:feature/nan-inf-pydantic-serialization

Conversation

@sp1thas

@sp1thas sp1thas commented Aug 28, 2024

Copy link
Copy Markdown

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

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

Additional Notes

@CLAassistant

CLAassistant commented Aug 28, 2024

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sp1thas sp1thas changed the title serialize nan and inf Bugfix/Serialize nan and inf as null Aug 28, 2024
@sakoush

sakoush commented Sep 5, 2024

Copy link
Copy Markdown
Contributor

@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 sakoush self-requested a review September 5, 2024 08:36
@sp1thas

sp1thas commented Sep 5, 2024

Copy link
Copy Markdown
Author

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 sp1thas closed this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants