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
Add Context.set_variable_resolver for lazy variable resolution
Exposes cel 0.13's VariableResolver trait to Python. The callback is
invoked with a variable name and returns the value (or None to fall
through to variables registered via add_variable). Useful for
contexts backed by databases, lazily-loaded config files, or other
sources where materializing every variable upfront is wasteful.
Exceptions from the callback are logged and treated as "not handled"
rather than propagated to the caller.
Refs #22
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
14
14
### Added
15
15
16
+
-`Context.set_variable_resolver(callback)` exposes cel 0.13's `VariableResolver` trait to Python. The callback receives a variable name and returns the value (or `None` to fall through to variables registered with `add_variable`). Useful for backing a CEL context with on-demand sources (database lookups, lazily-loaded config files, etc.) without materializing the full set of variables upfront. Exceptions raised by the resolver are logged and treated as "not handled".
16
17
- Idiomatic Python exception mapping for several CEL runtime errors that previously fell through to `ValueError`:
17
18
- Arithmetic overflow → `OverflowError` (e.g. `9223372036854775807 + 1`, including the new overflow-safe int math in cel 0.13).
18
19
- Division by zero / modulo by zero → `ZeroDivisionError`.
0 commit comments