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

python code generator dose not handle struct dependent

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Python - Compiler
    • Labels:
      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

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

                Dates

                • Created:
                  Updated: