[ 
https://issues.apache.org/jira/browse/THRIFT-1772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13773087#comment-13773087
 ] 

Hudson commented on THRIFT-1772:
--------------------------------

FAILURE: Integrated in Thrift #908 (See 
[https://builds.apache.org/job/Thrift/908/])
THRIFT-1772 Serialization does not check types of embedded structures. 
(henrique: rev f7be519e08d2c699e02aee691b3351441040df92)
* compiler/cpp/src/generate/t_py_generator.cc

                
> Serialization does not check types of embedded structures.
> ----------------------------------------------------------
>
>                 Key: THRIFT-1772
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1772
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Python - Library
>    Affects Versions: 0.8, 0.9
>            Reporter: Avi Flamholz
>            Assignee: Henrique Mendonça
>              Labels: python
>         Attachments: THRIFT-1772.patch, 
> thrift-py-serialize-check-struct-type.patch
>
>
> Consider the following struct definitions:
> struct Point {
>       1: required double x;
>       2: required double y;
> }
> struct Review {
>       1: required i32 rating;
>       2: optional string text;
> }
> struct Place {
>       1: required string name;
>       2: required Point location;
>       3: optional Review review;
> }
> If I create a Place object and set the location field to a Review, it will 
> serialize no problem.
> place = Place(name="avi's place", location=Review(rating=1.0))
> transportOut = TTransport.TMemoryBuffer()
> protocolOut = TBinaryProtocol.TBinaryProtocol(transportOut)
> place.write(protocolOut)
> serialized = transportOut.getvalue()
> This is confusing because if I set an i32 field to a string serialization 
> does raise an error.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to