Open NoamSherr opened 3 months ago
Yes.
Seen https://github.com/cloud-custodian/cel-python/blob/main/src/celpy/__init__.py which has a functions = {}
. This is the mapping from a CEL-visible name to a Python function.
Cool yeah I used it like that but it meant implementing the lambdas for the functions on my own - is there any intention of supporting the extensions that Go/Java have (String, Math and Optional) without the need for custom implementation?
So expressions like the following could run as well -
woops.title == "something" ? optional.none() : optional.of(woops.description)
or
my_string.upper()
without the need to pass the functions
dict to the celpy.Environment().program
.
Additionally if I want the optional
to be recognized as a namespace without declaring it as a var in the context (a bit "hack-ish") how can I do so? (with the existing functionality)
cel-go has support for the strings and math function extensions - is the extension supported? And if so how can it be set up in the environment ext/strings.go