[
https://issues.apache.org/jira/browse/THRIFT-1528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13627045#comment-13627045
]
Jens Geyer edited comment on THRIFT-1528 at 4/9/13 8:23 PM:
------------------------------------------------------------
Nate,
I just added a few sub-Tasks for some of the affected languages (we probably
need another one for Python, do we?). If you move the patches to their
respective tickets, I will commit the C# patch.
was (Author: jensg):
Nate,
I just added a few sub-Tasks for some of the affected languages. If you move
the patches to their respective tickets, I will commit the C# patch.
> Inconsistency in optional fields between Java/C# and python
> -----------------------------------------------------------
>
> Key: THRIFT-1528
> URL: https://issues.apache.org/jira/browse/THRIFT-1528
> Project: Thrift
> Issue Type: Bug
> Components: Python - Compiler
> Affects Versions: 0.8
> Reporter: Stefan Gmeiner
> Priority: Minor
> Attachments: 0001-Mark-defaulted-optionals-set-in-Java.patch,
> 0002-Mark-defaulted-optionals-set-in-C-sharp.patch
>
>
> If a struct contains optional fields with default values the generated python
> code serialize differently than Java or C# code.
> In Java or C# optional fields are only serialized if a field was set by the
> client. If not the field is omited during serialization. This is possible
> because C#/Java maintains for each field a 'isset'-boolean which records if a
> field was set or not.
> However the generated python code does not have such a 'isset'-structure. It
> writes every field which is not equal None. As the constructor initialize the
> optional fields with their default value, these fields are written whether
> they are set or not.
--
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