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

default function value ignored in partial eval #7220

Open
srenatus opened this issue Dec 13, 2024 · 1 comment
Open

default function value ignored in partial eval #7220

srenatus opened this issue Dec 13, 2024 · 1 comment

Comments

@srenatus
Copy link
Contributor

p.rego:

package filters
import rego.v1

include if cheap(input.fruits)

default cheap(_) := true
cheap(f) if f.price < 100

Eval with a fruit that has no price:

$ echo '{"fruits": {"name": "banana"}}' | opa eval -fpretty -I -d p.rego data.filters.include
true

Partial eval:

$ opa eval -fpretty -p -d p.rego data.filters.include
+---------+--------------------------+
| Query 1 | input.fruits.price < 100 |
+---------+--------------------------+

With the PE resuit, a fruit without a price would be denied. It shouldn't be. The default function value seems to be disregarded.

Copy link

stale bot commented Jan 14, 2025

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue.

@stale stale bot added the inactive label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant