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

Python generated "Service-remote" script doesn't honor service inheritance

    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      The python compiler generates a nice "Service-remove" script for making requests to the server.

      The script doesn't include any methods from inherited services.

      Example:

      service Base {
         i32 getStatus()
      }
      
      service Derived extends Base {
        string doWork()
      }
      

      Excerpt from generated Base-remote

        print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
        print ''
        print 'Functions:'
        print '  i32 getStatus()'
        print ''
      

      Excerpt from generated Derived-remote

        print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
        print ''
        print 'Functions:'
        print '  string doWork()'
        print ''
      

      Here we can see that Derived doesn't have a method defined for getStatus. These excerpts show just the usage statement but the implementation for getStatus doesn't exists either.

      Also on a different note the remote script depends on the Service.py script to be in the same directory. It would be nice if the import where absolute so that the script could be executed from any directory.

      Attachments

        1. THRIFT-1494.patch
          1 kB
          Nathaniel Cook

        Activity

          People

            nvcook42 Nathaniel Cook
            nvcook42 Nathaniel Cook
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: