Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore: normalize FieldPath parsing / escaping #6904

Merged
merged 5 commits into from
Dec 12, 2018
Merged

Firestore: normalize FieldPath parsing / escaping #6904

merged 5 commits into from
Dec 12, 2018

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Dec 11, 2018

Refactor:

  • Move FieldPath and related helpers to a new field_path module.
  • Rename 'get_field_path' helper -> 'render_field_path' to clarify intent.
  • Split out FieldPath.from_api_repr from existing FieldPath.from_string factory:
    • FieldPath.from_api_repr parses the path based on the API's quoting rules.
    • FieldPath.from_string first tries parsing using from_api_repr, but falls back to a more relaxed parsing.

Closes #6549.

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.
@tseaver tseaver added the api: firestore Issues related to the Firestore API. label Dec 11, 2018
@tseaver tseaver requested a review from crwilcox December 11, 2018 19:35
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 11, 2018
@tseaver tseaver merged commit 242e407 into googleapis:master Dec 12, 2018
@tseaver tseaver deleted the 6549-firestore-normalize_field_path_escaping branch December 12, 2018 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the Firestore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants