thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allen George <allen.geo...@gmail.com>
Subject Re: [jira] [Commented] (THRIFT-3783) python code generator dose not handle struct dependent
Date Sat, 07 Apr 2018 13:39:41 GMT
You would have to define B or import the file containing B before you use it in A. It's doesn't
seem like you did that in the snippet?

________________________________
From: ASF GitHub Bot (JIRA) <jira@apache.org>
Sent: Saturday, April 7, 2018 8:01:00 AM
To: dev@thrift.apache.org
Subject: [jira] [Commented] (THRIFT-3783) python code generator dose not handle struct dependent


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

ASF GitHub Bot commented on THRIFT-3783:
----------------------------------------

KarDik465 commented on issue #982: THRIFT-3783: python code generator dose not handle struct
dependent
URL: https://github.com/apache/thrift/pull/982#issuecomment-379464354


   This problem is actual.
   I have problems because of it

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> python code generator dose not handle struct dependent
> ------------------------------------------------------
>
>                 Key: THRIFT-3783
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3783
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Compiler
>            Reporter: Huabin
>            Priority: Minor
>
> given thrift idl
> {code}
> struct A {
> 1: B b,
> }
> struct B {
> 1: i32 b,
> }
> {code}
> generated ttypes.py
> {code}
> 20   class A:
>  21   """
>  22   Attributes:
>  23    - b
>  24   """
>  25
>  26   thrift_spec = (
>  27     None, # 0
>  28     (1, TType.STRUCT, 'b', (B, B.thrift_spec), None, ), # 1
>  29   )
>  30
> {code}
> import A will cause error since it referenced B, which has not be defined.



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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message