thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frederic Delbos (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-1745) Python JSON protocol
Date Fri, 02 Nov 2012 08:47:12 GMT

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

Frederic Delbos commented on THRIFT-1745:
-----------------------------------------

Yes there is a typo in TJSONProtocol.py line 49, it should be "rec" instead of "rect" sorry...
Also i run the test again and it seems there are other problems, coming from somewhere else
and affect all protocols:

 Apache Thrift - integration test suite
Fri Nov  2 09:31:33 CET 2012
======================================================
client-server:   protocol:   transport:        result:
cpp-cpp          binary      buffered-ip       success
cpp-cpp          binary      buffered-domain   success
cpp-cpp          binary      framed-ip         success
cpp-cpp          binary      framed-domain     success
cpp-cpp          binary      http-ip           success
cpp-cpp          binary      http-domain       success
cpp-cpp          json        buffered-ip       success
cpp-cpp          json        buffered-domain   success
cpp-cpp          json        framed-ip         success
cpp-cpp          json        framed-domain     success
cpp-cpp          json        http-ip           success
cpp-cpp          json        http-domain       success
py-py            binary      buffered-ip       success
py-py            json        buffered-ip       success
py-cpp           binary      buffered-ip       success
py-cpp           json        buffered-ip       success
cpp-py           binary      buffered-ip       failure
=================== server message ===================
Traceback (most recent call last):
  File "py/../../lib/py/build/lib.linux-x86_64-2.7/thrift/server/TServer.py", line 84, in
serve
    self.processor.process(iprot, oprot)
  File "py/gen-py/ThriftTest/ThriftTest.py", line 1006, in process
    self._processMap[name](self, seqid, iprot, oprot)
  File "py/gen-py/ThriftTest/ThriftTest.py", line 1170, in process_testMapMap
    result.write(oprot)
  File "py/gen-py/ThriftTest/ThriftTest.py", line 3054, in write
    oprot.writeMapBegin(TType.I32, TType.MAP, len(self.success))
TypeError: object of type 'int' has no len()
=================== client message ===================
testMap({0 => -10, 1 => -9, 2 => -8, 3 => -7, 4 => -6}) = {0 => -10, 1 =>
-9, 2 => -8, 3 => -7, 4 => -6}
testSet({-2, -1, 0, 1, 2}) = {-2, -1, 0, 1, 2}
testList({-2, -1, 0, 1, 2}) = {-2, -1, 0, 1, 2}
testEnum(ONE) = 1
testEnum(TWO) = 2
testEnum(THREE) = 3
testEnum(FIVE) = 5
testEnum(EIGHT) = 8
testTypedef(309858235082523) = 309858235082523
testMapMap(1)Aborted
======================================================

client-server:   protocol:   transport:        result:
cpp-py           json        buffered-ip       failure
=================== server message ===================
Traceback (most recent call last):
  File "py/../../lib/py/build/lib.linux-x86_64-2.7/thrift/server/TServer.py", line 84, in
serve
    self.processor.process(iprot, oprot)
  File "py/gen-py/ThriftTest/ThriftTest.py", line 1006, in process
    self._processMap[name](self, seqid, iprot, oprot)
  File "py/gen-py/ThriftTest/ThriftTest.py", line 1170, in process_testMapMap
    result.write(oprot)
  File "py/gen-py/ThriftTest/ThriftTest.py", line 3054, in write
    oprot.writeMapBegin(TType.I32, TType.MAP, len(self.success))
TypeError: object of type 'int' has no len()
=================== client message ===================
testMap({0 => -10, 1 => -9, 2 => -8, 3 => -7, 4 => -6}) = {0 => -10, 1 =>
-9, 2 => -8, 3 => -7, 4 => -6}
testSet({-2, -1, 0, 1, 2}) = {-2, -1, 0, 1, 2}
testList({-2, -1, 0, 1, 2}) = {-2, -1, 0, 1, 2}
testEnum(ONE) = 1
testEnum(TWO) = 2
testEnum(THREE) = 3
testEnum(FIVE) = 5
testEnum(EIGHT) = 8
testTypedef(309858235082523) = 309858235082523
testMapMap(1)Aborted
======================================================

                
> Python JSON protocol 
> ---------------------
>
>                 Key: THRIFT-1745
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1745
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Python - Library
>    Affects Versions: 1.0
>            Reporter: Frederic Delbos
>            Assignee: Roger Meier
>            Priority: Minor
>         Attachments: TJSONProtocol.py
>
>
> I write a JSON protocol for Python available here :  https://gist.github.com/3948701
So far it passes all the tests.
> Also you need to add json to the python test suit and 'TJSONProtocol' in  lib/py/src/protocol/__init__.py
> cheers

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message