We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
now
1 parent f6b1c39 commit 6071c3fCopy full SHA for 6071c3f
1 file changed
protovalidate/internal/rules.py
@@ -14,7 +14,6 @@
14
15
import dataclasses
16
import datetime
17
-import re
18
import typing
19
from collections.abc import Callable, Container, Iterable, Mapping
20
@@ -45,9 +44,6 @@ def _is_repeated(field: descriptor.FieldDescriptor) -> bool:
45
44
return field.label == descriptor.FieldDescriptor.LABEL_REPEATED # type: ignore[attr-defined]
46
47
48
-_NOW_RE = re.compile(r"\bnow\b")
49
-
50
51
class CompilationError(Exception):
52
pass
53
@@ -417,7 +413,7 @@ def add_rule(
417
413
rules = validate_pb2.Rule()
418
414
rules.id = expression
419
415
rules.expression = expression
420
- if _NOW_RE.search(rules.expression):
416
+ if "now" in rules.expression:
421
self._uses_now = True
422
ast = env.compile(rules.expression)
423
prog = env.program(ast, functions=funcs)
0 commit comments