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

Use comparable evaluators in partial evaluation and folding #68

Merged

Conversation

kjamieson-sdm
Copy link
Collaborator

This PR changes partial evaluation and folding to use the comparable value evaluators in place of the long comparison evaluators. This fixes issues where partial evaluation and folding would produce an error with less than/greater than/less than or equal/greater than or equal comparisons were performed against comparable values other than long (such as datetime).

For use where the signature of these functions is expected to return an Evaler.

Signed-off-by: Kevin Jamieson <kevin.jamieson@strongdm.com>
This ensures that folding works with other types of comparable values, such as
datetime, rather than producing an error.

Signed-off-by: Kevin Jamieson <kevin.jamieson@strongdm.com>
This ensures that partial evaluation works with other types of comparable
values, such as datetime, rather than producing an error.

Signed-off-by: Kevin Jamieson <kevin.jamieson@strongdm.com>
All callers have now been switched over to using the more generic comparable
value evalers, supporting all comparable types, not just long.

Signed-off-by: Kevin Jamieson <kevin.jamieson@strongdm.com>
The error string has changed now that using the comparable value evalers.

Signed-off-by: Kevin Jamieson <kevin.jamieson@strongdm.com>
Copy link
Collaborator

@philhassey philhassey left a comment

Choose a reason for hiding this comment

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

LGTM

@kjamieson-sdm kjamieson-sdm merged commit 257623d into cedar-policy:main Nov 19, 2024
3 checks passed
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