Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove stats with NaN values #1784

Merged
merged 3 commits into from
Aug 16, 2023
Merged

Remove stats with NaN values #1784

merged 3 commits into from
Aug 16, 2023

Conversation

yifanmai
Copy link
Collaborator

@yifanmai yifanmai commented Aug 15, 2023

Drop any instance stats that contain NaN, because Python's stdlib json.dumps() will produce invalid JSON when serializing a NaN.

See:

Addresses #1765

@@ -88,6 +89,19 @@ def process(self, request_state_set: RequestStateSet) -> List[Stat]:
)
)

# Drop any instance stats that contain NaN, because Python's stdlib json.dumps()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only question is whether this is the right place to put it. I think maybe we should at least make this a helper function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it could be better to put it closer to the point of serialization?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make it clear that upstream computation should not produce NaNs, and this is just a bandaid safety check? (In which case, we should fix things upstream.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I moved it to the point of serialization. I'll do the upstream fix in a different PR.

@yifanmai yifanmai merged commit a2f2b68 into main Aug 16, 2023
3 checks passed
@yifanmai yifanmai deleted the yifanmai/1765-nan branch August 16, 2023 17:20
danielz02 pushed a commit to danielz02/helm that referenced this pull request Sep 7, 2023
danielz02 pushed a commit to danielz02/helm that referenced this pull request Sep 7, 2023
danielz02 pushed a commit to danielz02/helm that referenced this pull request Sep 7, 2023
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.

2 participants