-
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
allow put and get to work with compressed blob properties #175
allow put and get to work with compressed blob properties #175
Conversation
Hi, hope it is ok, I had a look. |
True. See below.
I looked into this some this morning. The way NDB did this previously was by setting a "meaning uri" field of the protocol buffer to a custom value that was understood by NDB to mean it was a compressed property. Unfortunately, the modern incarnation of Datastore does not have a "meaning uri" field we can set. So, yes, currently the way NDB knows a value stored in Datastore is compressed is from the Property definition in the Python code. There's no information stored in Datastore to indicate that a property is compressed or not. The consequence of this is that, as you point out, you can't really change a property between compressed and uncompressed without introducing errors when trying to read back out previously written values. If this is particularly troublesome, we could look into storing BlobProperty values in some kind of wrapper that indicates compressed or uncompressed state. That could get complicated trying to preserve backwards compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine with caveats noted in comments.
@andrewsg Should we open an issue for the caveats explored in the comments?
@chrisrossi Thanks for the quick response. Thanks |
Hi @eyalhei, this PR will be out in a new version very soon. As far as the compressed tag caveats, let's not open an issue for it yet; I will make a note to raise this question to the Datastore team internally in our meeting next month and see what they think of it. |
Thank you |
From #160.