-
Notifications
You must be signed in to change notification settings - Fork 17
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
Representing -inf and inf in json #666
Comments
This can be done via pydantic: https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.ser_json_inf_nan Accepting |
The default value of >>> float("Infinity")
inf
>>> float("-Infinity")
-inf
>>> Should we change the ser_json_inf_nan config value to I can update the type annotation as |
Right, I think we can go for string representation. Using null is not entirely nonsense,iIf we go for that I would interpret it differently, it means unbounded. Inf is not very standard as well, e.g. python has None type, but inf is should be write as |
Currently the data range representation in yaml can support float infinity, but when trying to convert to json, since there is no native support for -inf and inf, we need to either convert to a string
Infinity
and-Infinity
or set it tonull
which represent no boundary. Not sure if we need to support in the spec, but maybe as a discussion for future versions.The text was updated successfully, but these errors were encountered: