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

Error propagation issues obfuscating root causes

Open Alfus opened this issue 2 years ago • 2 comments

We are seeing errors like:

found no matching overload for _?_:_ applied to '(<class 'celpy.evaluation.CELEvalError'>, <class 'celpy.celtypes.StringType'>, <class 'celpy.celtypes.StringType'>)'", <class 'TypeError'>, ("Unexpected <class 'celpy.evaluation.CELEvalError'> ? <class 'celpy.celtypes.StringType'> : <class 'celpy.celtypes.StringType'>

Which is obfuscating the underlying error that occured in the argument to conditional.

This appears to be happening because the arguments to both registered and builtin functions are not being checked before passed in as celtypes.Value. Ideally 'strict' functions would have all the arguments sanctity checked, and any errors in the arguments would be propagated instead of invoking the function, while the logical operators, && and ||, and built in '@not_strictly_false` should be tolerant of some errors in the arguments.

Alfus avatar Jun 07 '23 19:06 Alfus

pull requests welcome

kapilt avatar Jul 22 '23 15:07 kapilt

It's not perfectly clear (to me) what the benchmark Go implementation does in this case.

I'm unclear on where the Go implementation does type-checking.

slott56 avatar May 21 '24 17:05 slott56