Skip to content

Commit a6a99ea

Browse files
committed
remove problematic regex check
1 parent 1f4447b commit a6a99ea

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

google/cloud/firestore_v1/field_path.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
_ESCAPED_BACKTICK = _BACKSLASH + _BACKTICK
3232

3333
_SIMPLE_FIELD_NAME = re.compile("^[_a-zA-Z][_a-zA-Z0-9]*$")
34-
_LEADING_ALPHA_INVALID = re.compile("^[_a-zA-Z][_a-zA-Z0-9]*[^_a-zA-Z0-9]")
3534
PATH_ELEMENT_TOKENS = [
3635
("SIMPLE", r"[_a-zA-Z][_a-zA-Z0-9]*"), # unquoted elements
3736
("QUOTED", r"`(?:\\`|[^`])*?`"), # quoted elements, unquoted
@@ -309,12 +308,6 @@ def from_string(cls, path_string: str):
309308
for element in elements:
310309
if not element:
311310
raise ValueError("Empty element")
312-
if _LEADING_ALPHA_INVALID.match(element):
313-
raise ValueError(
314-
"Non-alphanum char in element with leading alpha: {}".format(
315-
element
316-
)
317-
)
318311
return FieldPath(*elements)
319312

320313
def __repr__(self):

0 commit comments

Comments
 (0)