Firestore: normalize FieldPath parsing / escaping#6904
Merged
tseaver merged 5 commits intogoogleapis:masterfrom Dec 12, 2018
tseaver:6549-firestore-normalize_field_path_escaping
Merged
Firestore: normalize FieldPath parsing / escaping#6904tseaver merged 5 commits intogoogleapis:masterfrom tseaver:6549-firestore-normalize_field_path_escaping
tseaver merged 5 commits intogoogleapis:masterfrom
tseaver:6549-firestore-normalize_field_path_escaping
Conversation
Add 'FieldPath.from_api_repr', which parses the path based on the API's quoting rules. In 'FieldPath.from_string', try 'from_api_repr', but fall back to a more relaxed parsing. In '_tokenize_field_path', raise an exception if any characters remain unconsumed at the end. Closes #6549.
crwilcox
reviewed
Dec 12, 2018
[ci skip]
parthea
pushed a commit
that referenced
this pull request
Nov 24, 2025
Refactor:
- Move 'FieldPath' / related helpers to a new 'field_path' module.
- Rename 'get_field_path' helper -> 'render_field_path'.
- Split 'FieldPath.from_string' factory:
- Add 'FieldPath.from_api_repr', which parses the path based on the
API's quoting rules.
- In 'FieldPath.from_string', try 'from_api_repr', but fall back to a
more relaxed parsing.
Closes #6549.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor:
FieldPathand related helpers to a newfield_pathmodule.FieldPath.from_api_reprfrom existingFieldPath.from_stringfactory:FieldPath.from_api_reprparses the path based on the API's quoting rules.FieldPath.from_stringfirst tries parsing usingfrom_api_repr, but falls back to a more relaxed parsing.Closes #6549.