-
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
Binary support #164
Binary support #164
Conversation
# Conflicts: # thriftpy2/protocol/apache_json.py
…ated calls to `self.trans.read(1)` takes a long time with large requests (cherry picked from commit 89c4cb1)
(cherry picked from commit 1088e68)
(cherry picked from commit 8923d97)
(cherry picked from commit 162ad2b)
(cherry picked from commit d87d5cc)
(cherry picked from commit 1d5c395)
(cherry picked from commit 4dcff99)
(cherry picked from commit bb4ea29)
(cherry picked from commit 6d1b8c9)
(cherry picked from commit b33ac62)
(cherry picked from commit d106140)
(cherry picked from commit 2fef901)
(cherry picked from commit 9031ed8)
(cherry picked from commit 8b97de9)
(cherry picked from commit 506f52e)
(cherry picked from commit 19c833b)
(cherry picked from commit 03431f8)
(cherry picked from commit ded0e10)
(cherry picked from commit a9ca53f)
(cherry picked from commit fe4242b)
(cherry picked from commit ced7937)
(cherry picked from commit 1963f85)
(cherry picked from commit 23ab765)
(cherry picked from commit 624d763)
(cherry picked from commit 1ef62fe)
Made asyncio binary protocol backward compatible with apache thrift (cherry picked from commit dc1bab2)
(cherry picked from commit 6b35a72)
(cherry picked from commit a60739a)
(cherry picked from commit e1e9a53)
(cherry picked from commit 5a4fcbb)
(cherry picked from commit 7945d78)
(cherry picked from commit a77ded3)
Codecov Report
@@ Coverage Diff @@
## master #164 +/- ##
==========================================
+ Coverage 83.37% 84.31% +0.94%
==========================================
Files 43 44 +1
Lines 3939 4164 +225
==========================================
+ Hits 3284 3511 +227
+ Misses 655 653 -2
Continue to review full report at Codecov.
|
@ethe are you able to look at this at some point? |
I will take a look at it, could you please remove [WIP] in the title? |
@ethe I have fixed the title. |
I have a question, does it break the compatibility? If the user defines a binary type and treats it as a string before, what happened after this commit merged? |
Maybe we should consider that only turn on this feature in JSON protocol and do not modify others, or turn off it as default in other protocols. |
@ethe please check If a string is passed to a binary field, when deserialised you always get a binary. Conversely, if a binary is passed to a string field, it should be stringified (if possible) when deserializing. |
Added binary support per #156
I've added some more tests to cover more cases surrounding binary encodings. If you pass a string to a binary field, it will come out as a bytes type on the other end.
The work here builds off #163 , so that will probably need to be merged before this one.