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

Implementing GeoPtProperty in ndb. #6432

Merged
merged 4 commits into from
Nov 7, 2018

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Nov 7, 2018

In the process also:

  • Adding google.cloud.ndb._ports to bring in "necessary" classes from the GAE standard SDK

This is incomplete for now but I wanted to send it so I didn't forget the comments I had about the implementation.

@dhermes dhermes requested a review from chrisrossi November 7, 2018 01:19
@dhermes dhermes requested a review from crwilcox as a code owner November 7, 2018 01:19
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 7, 2018
# See the License for the specific language governing permissions and
# limitations under the License.

"""Ported implementations from the Google App Engine SDK.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

return "datastore_types.GeoPt({!r}, {!r})".format(self.lat, self.lon)

def __str__(self):
return "{},{}".format(self.lat, self.lon)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -1679,8 +1680,8 @@ class BlobProperty(Property):
default (bytes): The default value for this property.
choices (Iterable[bytes]): A container of allowed values for this
property.
validator (Callable[[Property, Any], bool]): A validator to be used
to check values.
validator (Callable[[~google.cloud.ndb.model.Property, Any], bool]): A

This comment was marked as spam.

@dhermes dhermes added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 7, 2018


@functools.total_ordering
class GeoPt:

This comment was marked as spam.

# See the License for the specific language governing permissions and
# limitations under the License.

"""Ported implementations from the Google App Engine SDK.

This comment was marked as spam.

Returns:
str: The repr for this instance.
"""
return "datastore_types.GeoPt({!r}, {!r})".format(self.lat, self.lon)

This comment was marked as spam.

This comment was marked as spam.

@dhermes dhermes force-pushed the ndb-add-GeoPtProperty branch from 0223f6e to ccc98d1 Compare November 7, 2018 17:13
@dhermes dhermes removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 7, 2018
@dhermes dhermes force-pushed the ndb-add-GeoPtProperty branch 2 times, most recently from a4437de to 8331456 Compare November 7, 2018 18:58
@dhermes dhermes force-pushed the ndb-add-GeoPtProperty branch from 8331456 to 4b6bc05 Compare November 7, 2018 18:58
@dhermes dhermes merged commit e3c44d8 into googleapis:master Nov 7, 2018
@dhermes dhermes deleted the ndb-add-GeoPtProperty branch November 7, 2018 19:36
chrisrossi pushed a commit to chrisrossi/google-cloud-python that referenced this pull request Feb 22, 2019
Using `GeoPoint` from `google-cloud-datastore`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: ndb 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