Skip to content

Commit 67402e1

Browse files
Add previous fixes
From #340.
1 parent d8fe72f commit 67402e1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
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

0 commit comments

Comments
 (0)