Docker(python:3.7.3)python:3.7.3google-cloud-firestore==1.2.0.where(f"something.3blah", "==", True) on a collection.ref = (
db.collection("mycollection")
.where(f"something.3a", "==", True)
)
Traceback (most recent call last):
File "test.py", line 68, in <module>
split_field_path('seomthing.3a')
File "test.py", line 49, in split_field_path
for element in _tokenize_field_path(path):
File "test.py", line 30, in _tokenize_field_path
raise ValueError("Path {} not consumed, residue: {}".format(path, path[pos:]))
ValueError: Path seomthing.3a not consumed, residue: 3a
Have narrowed down the issue to this function: https://github.com/googleapis/google-cloud-python/blob/master/firestore/google/cloud/firestore_v1beta1/field_path.py#L71
Reproducible snippet: (https://gist.github.com/jakebolam/7983326e41672a473365d0d46b643e6f)
Thanks for the report
The rules for field paths are a little complicated. You need to escape any path element which is not an "identifier"; e.g., in your case:
ref = (
db.collection("mycollection")
.where(f"something.`3a`", "==", True)
)
Thanks for the speedy response @tseaver. That definitely gets things working. Cheers
Most helpful comment
The rules for field paths are a little complicated. You need to escape any path element which is not an "identifier"; e.g., in your case: