Format 0.0 facet values consistently with other floats - #294
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
gvanrossum
reviewed
Jul 24, 2026
gvanrossum
approved these changes
Jul 24, 2026
gvanrossum
left a comment
Collaborator
There was a problem hiding this comment.
Yeah, TypeAgent had the correct behavior (0.0 -> "0") all along.
Contributor
Author
|
Thanks for the quick review and merge! |
Contributor
Author
|
Thanks again for the review on this one. If there are other areas of the Python port you'd like a hand with, feel free to ping me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When indexing a facet whose value is a float, the code formats it with
:g, but the guard isisinstance(value, float) and value— theand valueskips0.0(it's falsy), so a facet value of0.0gets stored as"0.0"while every other float uses:g(e.g.2.0->"2"). The comment right above says "If the value is a float, we use .g format", so the extra truthiness check looks unintended.Dropped
and valuein the two places that do this (add_facetandcollect_facet_properties) so0.0is formatted like any other float ("0"). Added a small test. Full offline test suite still passes.