Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implementing JsonProperty in ndb. #6447

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

Merged
merged 8 commits into from
Nov 8, 2018

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Nov 7, 2018

No description provided.

@dhermes dhermes requested a review from chrisrossi November 7, 2018 23:21
@dhermes dhermes requested a review from crwilcox as a code owner November 7, 2018 23:21
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 7, 2018
@@ -2082,6 +2083,11 @@ def _db_get_value(self, v, unused_p):
class PickleProperty(BlobProperty):
"""A property that contains values that are pickle-able.

.. note::

Unlike most property types, a :class:`PickleProperty` is **not**

This comment was marked as spam.

@@ -1463,6 +1463,7 @@ def test_constructor_explicit():
write_empty_list=False,
)
assert prop._name == b"blob_val" and prop._name != "blob_val"
assert prop._compressed

This comment was marked as spam.

Returns:
bytes: The ``value``, JSON encoded as an ASCII byte string.
"""
as_str = json.dumps(value, separators=(",", ":"), ensure_ascii=True)

This comment was marked as spam.

@dhermes dhermes force-pushed the ndb-add-JsonProperty branch from abec152 to 19cb5ea Compare November 8, 2018 20:16
@dhermes
Copy link
Contributor Author

dhermes commented Nov 8, 2018

@chrisrossi PTAL, I made _from_base_type accept only bytes.

Copy link

@chrisrossi chrisrossi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dhermes dhermes merged commit 8810e4e into googleapis:master Nov 8, 2018
@dhermes dhermes deleted the ndb-add-JsonProperty branch November 8, 2018 20:24
chrisrossi pushed a commit to chrisrossi/google-cloud-python that referenced this pull request Feb 22, 2019
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