Skip to content

Comments

Firestore: normalize FieldPath parsing / escaping#6904

Merged
tseaver merged 5 commits intogoogleapis:masterfrom
tseaver:6549-firestore-normalize_field_path_escaping
Dec 12, 2018
Merged

Firestore: normalize FieldPath parsing / escaping#6904
tseaver merged 5 commits intogoogleapis:masterfrom
tseaver:6549-firestore-normalize_field_path_escaping

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
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.
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