-
Notifications
You must be signed in to change notification settings - Fork 67
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
Compressed JsonProperty (or Blob) exception #160
Comments
Hi Again, The read issue I solved with the following code change in BlobProperty: def _from_base_type(self, value):
"""Convert a value from the "base" value type for this property.
Args:
value (bytes): The value to be converted.
Returns:
Optional[bytes]: The converted value. If the current property is
a (wrapped) compressed value, this will unwrap the value and return
the decompressed form. Otherwise, it will return :data:`None` to
indicate that the value didn't need to be unwrapped and
decompressed.
"""
if self._compressed and not isinstance(value, _CompressedValue):
value = _CompressedValue(value)
if isinstance(value, _CompressedValue):
return zlib.decompress(value.z_val) |
Thanks a lot for this report. We'll look into it this week. |
Hi, anything I can do to help? |
Thanks a lot for your interest. We are planning to make a new release very soon. We'll try to figure this one out before then. It would be very helpful if you can keep testing your code and see if you spot any other issues. |
Another issue that might be related, but I don't have a standalone reproduction:
From what I saw in the code, I guess there is some flag to let datastore know this is a compressed value and I guess it was deleted (kinda new to the entire app engine world) |
Thanks for following up. We'll see if there's something that can be done about the compressed flag, but for now I'll close this. |
Hi,
I have an issue with saving and reading compressed json properties using the lib. I think the problem is on BlobProperty level.
My versions:
python 3.7
google-cloud-core==1.0.3
google-cloud-datastore==1.7.3
google-cloud-ndb==0.0.1
Reproduction code:
When I try to save a new object I get an exception:
I also tried reading an object written in python27 and got the following exception:
Thanks!
The text was updated successfully, but these errors were encountered: