Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3783

python code generator dose not handle struct dependent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Python - Compiler
    • None

    Description

      given thrift idl

      struct A {
      1: B b,
      }
      
      struct B {
      1: i32 b,
      }
      

      generated ttypes.py

      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  
      

      import A will cause error since it referenced B, which has not be defined.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cpper Huabin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: