File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ from collections .abc import Callable
1516from dataclasses import dataclass
16- from typing import Callable , Optional
17+ from typing import Optional
1718
1819
1920@dataclass
Original file line number Diff line number Diff line change 1515import math
1616import re
1717import typing
18+ from collections .abc import Callable
1819from urllib import parse as urlparse
1920
2021import celpy
@@ -1555,7 +1556,7 @@ def __peek(self, char: str) -> bool:
15551556 return self ._index < len (self ._string ) and self ._string [self ._index ] == char
15561557
15571558
1558- def get_matches_func (matcher : typing .Optional [typing . Callable [[str , str ], bool ]]):
1559+ def get_matches_func (matcher : typing .Optional [Callable [[str , str ], bool ]]):
15591560 if matcher is None :
15601561 matcher = protovalidate_matches
15611562
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def matches(text: str, pattern: str) -> bool:
4848 function via the Config.
4949
5050 Raises:
51- celpy.CELEvalError: If pattern contains invalid re2 syntax.
51+ celpy.CELEvalError: If pattern contains invalid re2 syntax or if an re.error is raised during matching .
5252 """
5353 # Simulate re2 by failing on any patterns not compatible with re2 syntax
5454 for invalid_pattern in invalid_patterns :
Original file line number Diff line number Diff line change 1515import dataclasses
1616import datetime
1717import typing
18+ from collections .abc import Callable
1819
1920import celpy
2021from celpy import celtypes
@@ -44,7 +45,7 @@ def unwrap(msg: message.Message) -> celtypes.Value:
4445 return field_to_cel (msg , msg .DESCRIPTOR .fields_by_name ["value" ])
4546
4647
47- _MSG_TYPE_URL_TO_CTOR : dict [str , typing . Callable [..., celtypes .Value ]] = {
48+ _MSG_TYPE_URL_TO_CTOR : dict [str , Callable [..., celtypes .Value ]] = {
4849 "google.protobuf.Duration" : make_duration ,
4950 "google.protobuf.Timestamp" : make_timestamp ,
5051 "google.protobuf.StringValue" : unwrap ,
You can’t perform that action at this time.
0 commit comments