-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
All strings should simplify without "b" and additional comma #2423
Comments
It's also worth noting that upon creating a plan, I've noticed other places where unnecessary commas are being added, here are a few examples:
|
That additional b comes from PySyft/syft/serde/native_serde.py Line 202 in 64cbc07
Another option is to decode the second element of tuple if the first element is 5 i.e. second element is a string. |
Same line PySyft/syft/serde/native_serde.py Line 202 in 64cbc07
is reposponsible for unnecessary commas along with Line 647 in 64cbc07
But when you remove the trailing comma you get explected output. But PySyft implementation is based on iterative parsing thus that lead to 327 failed test cases. I can change those implementation if required :) |
Go for it @Ankit-Dhankhar! If we need to leave the |
Sure, I am on it :) |
For string (code = 5), it's probably fine to simplify it into In python syntax it's not possible to make tuple with single element without that comma, because it's indistinguishable from simple parentheses:
If you need to generate correct python representation, extra comma needs to be in tuple with single element to make it tuple :) With 2 or more elements comma is not necessary of course. |
@vvmnnnkv You're actually correct here, I didn't realize it was standard practice. In this case - I think I'm going to close this ticket. Sorry @Ankit-Dhankhar - although, I could really use your help here: #2424 |
Describe the bug
MsgPack or something is prepending all strings with a
b
character and ending them with an unnecessary,
. These have to be manually removed via a Regex function in syft.js and makes testing quite inconsistent.To Reproduce
sy.serde._simplify('hello')
produces:(5, (b'hello',))
Expected behavior
(5, ('hello'))
Screenshots
Desktop
Additional context
This is a "nice to have" functionality for myself and @mccorby when developing the Javascript and Kotlin ports of Serde.
The text was updated successfully, but these errors were encountered: