Skip to content

Commit

Permalink
2nd review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelnucfin committed Mar 6, 2018
1 parent 09e834d commit 1843740
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions firestore/google/cloud/firestore_v1beta1/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,23 @@ class FieldPath(object):

def __init__(self, *parts):
for part in parts:
try:
string = basestring
except NameError:
string = str
if not isinstance(part, string):
if not isinstance(part, six.string_types):
raise ValueError("One or more components is not a string.")
self.parts = tuple(parts)

@staticmethod
def from_string(string):
""" Creates a FieldPath from an unicode string representation.
""" Creates a FieldPath from a unicode string representation.
Args:
:type string: str
:param string: An unicode string which cannot contain
:param string: A unicode string which cannot contain
`~*/[]` characters, cannot exceed 1500 bytes,
and cannot be empty.
Returns:
A :class: `FieldPath` instance with the string as path.
A :class: `FieldPath` instance with the string split on "."
as arguments to `FieldPath`.
"""
invalid_characters = '~*/[]'
string = string.split('.')
Expand Down

0 comments on commit 1843740

Please sign in to comment.