Hi everyone,
We are evaluating, no pun intended, CEL as a generic expression framework in a process execution engine here at
Morf Health . We use protobufs (syntax=3) to represent all of our data that we would like to be passed into our programs for evaluation. We also make heavy use of the `optional` keyword within our stack (golang), to represent data that isn't specified - which is obviously different to the default case.
e.g.```proto
message Patient {
string first_name = 1;
optional last_name = 2;
//...
}
```
What we want to achieve ideally is the removal of the `types.Optional` type that this `last_name` field is converted to during program evaluation - instead rendering this field as a nullable type, so that we can do things in a program like compare strings `last_name == "morf"`. As you may know, right now this gives a type error presently as it's impossible to compare `Optional(String)` and `String`, I think this is true of all binary operators and functions...
I found some references to a `CustomTypeAdapter` being able to essentially map over the input data to achieve this objective, but I can't make it work.
Would anybody be able to kindly provide any pointers as to whether this is achievable and if so how? If we can't treat these optional fields as if they were just null values it would make our expression usage intolerably complicated for our users.
Any advice you could give us would be greatly appreciated! Thank you very much for your help in advance!