You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Brian Forbis (JIRA)" <ji...@apache.org> on 2018/08/07 19:43:00 UTC

[jira] [Commented] (THRIFT-4510) Regression in 0.11: Arrays with default values in python

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

Brian Forbis commented on THRIFT-4510:
--------------------------------------

FYI, I just ran into this issue as well while trying to upgrade some clients to v11. Seems to be that python code fails to compile if you default a struct attribute which is a Map container to an empty Map. I'll see if I can get a reproduction at some point

> Regression in 0.11: Arrays with default values in python
> --------------------------------------------------------
>
>                 Key: THRIFT-4510
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4510
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Compiler
>    Affects Versions: 0.11.0
>            Reporter: Jason Gauci
>            Priority: Critical
>
> We are getting reports from users that our project is broken on thrift 0.11.  Arrays with default values are newly broken in 0.11 because thrift_spec is not defined soon enough.
>  
> To reproduce:
>  
> brew install thrift
> git clone [https://github.com/caffe2/BlueWhale.git]
> cd BlueWhale
> thrift --gen py --out . ml/rl/thrift/core.thrift
> cat ml/rl/thrift/core/ttypes.py
>  
> Notice that the TrainingParameters.__init__ tries to use thrift_spec to handle the default array when thrift_spec doesn't exist yet.  This results in this failure upon import:
>  
> AttributeError: 'TrainingParameters' object has no attribute 'thrift_spec'
>  
> The same thing works when using 0.10



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)