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
is_number does not correctly return false (also the other is_ type checking builtins) #4943
Comments
Some of this could be worked around with helper methods... import future.keywords
number_(x) if is_number(x)
number_(x) := false if not is_number(x)
x := number_("foo")
y := number_(2) |
We just recently made this exact change for the various |
Looking at the policy reference for |
From the Policy Reference page this is the precise list of |
Fixes open-policy-agent#4943 Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Fixes #4943 Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Short description
Steps To Reproduce
Expected behavior
Should return false according to docs and according to design.
https://www.openpolicyagent.org/docs/latest/policy-reference/#builtin-types-is_number
Additional context
Seems to affect the other type checking builtins too. Because they are all affected, there may be a thought to simply adopt the current behavior as THE CORRECT behavior. But the current behavior has some serious downsides such as:
is_
builtins in Rego which return false (at least according to docs) and lead to confusion/frustration.is_number(x)
as an argument into another function call.The text was updated successfully, but these errors were encountered: