-
Notifications
You must be signed in to change notification settings - Fork 93
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
v0.4.13 serialization break #156
Comments
I think maybe I have to revert this merge #139 and have a discussion again about the binary type support |
Hold this issue before Apache JSON protocol re-merge. |
I'll have a look at this when I get back to work on Monday |
@JonnoFTW Thanks for your work! I have several suggestions:
|
How do you want Thrifpy2's Apache JSON to handle the case where it doesn't support binary? Apache's thrift will send binary data as base64 encoded string. If we don't support binary in Apache JSON, then the result will be that thriftpy2 gets a base64 encoded string. From the test, without binary support, apache json will make the following field: tbinary=b"\x01\x0fabc123\x00\x02" Into this: "19":{'str': 'AQ9hYmMxMjMAAg=='}} Without binary support, my apache thrift protocol has no way of knowing whether or not to decode the above base64 encoded string. If we try to decode any string field using base64.b64decode(b"notbas64") Is a valid string and a valid base64 encoded string.
What do you mean? Please provide an example.
Currently, if a thrift field is specified as binary and you pass a string, the string is serialised to an appropriate intermediate binary representation as appropriate. When deserialising, it is converted back to a python |
relay to #139, a quick verification:
TType was be specified in Apache Thrift standard, and Binary type should always have the same behavior with String in kinds of protocols, hence we missed some check to modify the value of Binary: 18 to String: 11 in complex type serialization (map, list, etc.).
The text was updated successfully, but these errors were encountered: