Skip to content

Commit 2ebcee3

Browse files
Upgrade cel-python to 0.4
Ref: https://github.com/cloud-custodian/cel-python/releases/tag/v0.4 A couple new conformance test failures so far, so probably will have to hold off. Previous upgrade attempt to 0.3: #314
1 parent caae239 commit 2ebcee3

File tree

3 files changed

+147
-32
lines changed

3 files changed

+147
-32
lines changed

protovalidate/internal/cel_field_presence.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import threading
1616

1717
import celpy
18+
import celpy.celtypes
1819

1920
_has_state = threading.local()
2021

@@ -32,14 +33,14 @@ def in_has() -> bool:
3233

3334

3435
class InterpretedRunner(celpy.InterpretedRunner):
35-
def evaluate(self, context):
36+
def evaluate(self, context) -> celpy.celtypes.Value:
3637
class Evaluator(celpy.Evaluator):
37-
def macro_has_eval(self, exprlist):
38+
def macro_has_eval(self, exprlist) -> celpy.celtypes.BoolType:
3839
_has_state.in_has = True
3940
result = super().macro_has_eval(exprlist)
4041
_has_state.in_has = False
4142
return result
4243

43-
e = Evaluator(ast=self.ast, activation=self.new_activation(context), functions=self.functions)
44-
value = e.evaluate()
44+
e = Evaluator(ast=self.ast, activation=self.new_activation())
45+
value = e.evaluate(context)
4546
return value

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ classifiers = [
2222
dynamic = ["version"]
2323
dependencies = [
2424
"protobuf==6.*",
25-
"cel-python==0.2.*",
25+
"cel-python==0.4.*",
2626
]
2727

2828
[project.urls]

0 commit comments

Comments
 (0)