You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PE generates support rules for partial documents if the reference requires the full extent of the document. However, if none of the rules that generate the document are defined, the document should be considered empty (not undefined). Currently PE does not generate the correct output in this case (it generates a reference to a non-existent/undefined virtual document.)
Example:
data.foo.p = x
package foo
p[1] { input; false }
In this case, when PE runs on the query above, the body of p is undefined (because of the expression "false") however the current output is an empty set (undefined). We can fix this by unifying the other term in the query with the empty value for the virtual document (i.e., set() or {}).
The text was updated successfully, but these errors were encountered:
This commit fixes an issue in partial eval whereby OPA would generate
an incorrect expression referring to a non-existent/undefined virtual
document. This would occur if an expression referenced the full extent
of a virtual document generated by partial rules and those partial
rules were all undefined. In that case, the reference needs to be
unified with the default (empty) value for that virtual document.
Fixesopen-policy-agent#2492
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
PE generates support rules for partial documents if the reference requires the full extent of the document. However, if none of the rules that generate the document are defined, the document should be considered empty (not undefined). Currently PE does not generate the correct output in this case (it generates a reference to a non-existent/undefined virtual document.)
Example:
In this case, when PE runs on the query above, the body of
p
is undefined (because of the expression "false") however the current output is an empty set (undefined). We can fix this by unifying the other term in the query with the empty value for the virtual document (i.e.,set()
or{}
).The text was updated successfully, but these errors were encountered: