cel-java icon indicating copy to clipboard operation
cel-java copied to clipboard

Comprehensions with iteration index/key

Open oridag opened this issue 1 year ago • 1 comments

I see that AST support for comprehensions that include an extra iterVar that is populated with the index (lists) or key (maps) was recently introduced in the expr proto: https://github.com/googleapis/googleapis/commit/24be099a87c35691e18261c0da28f7b711cc6416

Any guidance on if and when we can expect it in the cel-java runtime?

oridag avatar Nov 27 '24 13:11 oridag

Support for two variable comprehensions will be added for CEL-Java in the future. This was added in cel-go recently, so we'll just need to port this over: https://github.com/google/cel-go/pull/1034/. We don't know when yet, but my guess is that we'll start tackling this sometime in early 2025. The feature is pretty self contained -- we wouldn't mind accepting contribution on the port if you need this much sooner.

l46kok avatar Nov 27 '24 17:11 l46kok

Included in the latest release https://github.com/google/cel-java/releases/tag/v0.11.0

l46kok avatar Sep 04 '25 20:09 l46kok