You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Kim van der Riet <ki...@redhat.com> on 2015/11/24 17:29:07 UTC

Review Request 40648: Update Python API to reflect correct types as defined in AMQP 1.0 spec

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40648/
-----------------------------------------------------------

Review request for qpid, Justin Ross and Kenneth Giusti.


Bugs: PROTON-1060
    https://issues.apache.org/jira/browse/PROTON-1060


Repository: qpid-proton-git


Description
-------

Several of the Python binding API calls for message properties do not use the correct types.  To align them properly with the AMQP 1.0 spec, the following APIs need changing:

Subject
-------
The spec for this is: <field name="subject" type="string"/>
_get_subject() should return a unicode string, not a regular string;
_set_subject() should accept a unicode string, not a regular string.

Content Type
------------
The spec for this is: <field name="content-type" type="symbol"/>
_get_content_type() should return a symbol, not a regular string;
_set_content_type() should accept a symbol, not a regular string.

Content Encoding
----------------
The spec for this is <field name="content-encoding" type="symbol"/>
_get_content_encoding() should return a symbol, not a regular string;
_set_content_encoding() should accept a symbol, not a regular string.

Group Id
--------
The spec for this is <field name="group-id" type="string"/>
_get_group_id() should return a unicode string, not a regular string;
_set_group_id() should accept a unicode string, not a regular string.

Reply-To Group Id
-----------------
The spec for this is <field name="reply-to-group-id" type="string"/>
_get_reply_to_group_id() should return a unicode string, not a regular string;
_set_reply_to_group_id() should accept a unicode string, not a regular string.

This patch makes the above changes to the API.


Diffs
-----

  proton-c/bindings/python/proton/__init__.py 2a87fe7b267589ad65a3eb26dc196406288dbbad 
  tests/python/proton_tests/message.py 7aa9fac239ba6ee62e46588f855bb4e72d63a0e7 

Diff: https://reviews.apache.org/r/40648/diff/


Testing
-------

The tests proton_tests.message.AccessorsTest.testContentType and proton_tests.message.AccessorsTest.testContentEncoding were modified to use the new API type. The python tests pass.

This has been tested fairly extensively within qpid-interop-test, and works as it should.


Thanks,

Kim van der Riet


Re: Review Request 40648: Update Python API to reflect correct types as defined in AMQP 1.0 spec

Posted by Alan Conway <ac...@redhat.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40648/#review108387
-----------------------------------------------------------

Ship it!


Ship It!

- Alan Conway


On Nov. 24, 2015, 4:29 p.m., Kim van der Riet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40648/
> -----------------------------------------------------------
> 
> (Updated Nov. 24, 2015, 4:29 p.m.)
> 
> 
> Review request for qpid, Justin Ross and Kenneth Giusti.
> 
> 
> Bugs: PROTON-1060
>     https://issues.apache.org/jira/browse/PROTON-1060
> 
> 
> Repository: qpid-proton-git
> 
> 
> Description
> -------
> 
> Several of the Python binding API calls for message properties do not use the correct types.  To align them properly with the AMQP 1.0 spec, the following APIs need changing:
> 
> Subject
> -------
> The spec for this is: <field name="subject" type="string"/>
> _get_subject() should return a unicode string, not a regular string;
> _set_subject() should accept a unicode string, not a regular string.
> 
> Content Type
> ------------
> The spec for this is: <field name="content-type" type="symbol"/>
> _get_content_type() should return a symbol, not a regular string;
> _set_content_type() should accept a symbol, not a regular string.
> 
> Content Encoding
> ----------------
> The spec for this is <field name="content-encoding" type="symbol"/>
> _get_content_encoding() should return a symbol, not a regular string;
> _set_content_encoding() should accept a symbol, not a regular string.
> 
> Group Id
> --------
> The spec for this is <field name="group-id" type="string"/>
> _get_group_id() should return a unicode string, not a regular string;
> _set_group_id() should accept a unicode string, not a regular string.
> 
> Reply-To Group Id
> -----------------
> The spec for this is <field name="reply-to-group-id" type="string"/>
> _get_reply_to_group_id() should return a unicode string, not a regular string;
> _set_reply_to_group_id() should accept a unicode string, not a regular string.
> 
> This patch makes the above changes to the API.
> 
> 
> Diffs
> -----
> 
>   proton-c/bindings/python/proton/__init__.py 2a87fe7b267589ad65a3eb26dc196406288dbbad 
>   tests/python/proton_tests/message.py 7aa9fac239ba6ee62e46588f855bb4e72d63a0e7 
> 
> Diff: https://reviews.apache.org/r/40648/diff/
> 
> 
> Testing
> -------
> 
> The tests proton_tests.message.AccessorsTest.testContentType and proton_tests.message.AccessorsTest.testContentEncoding were modified to use the new API type. The python tests pass.
> 
> This has been tested fairly extensively within qpid-interop-test, and works as it should.
> 
> 
> Thanks,
> 
> Kim van der Riet
> 
>


Re: Review Request 40648: Update Python API to reflect correct types as defined in AMQP 1.0 spec

Posted by Kenneth Giusti <kg...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40648/#review108378
-----------------------------------------------------------

Ship it!


Ship It!

- Kenneth Giusti


On Nov. 24, 2015, 4:29 p.m., Kim van der Riet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40648/
> -----------------------------------------------------------
> 
> (Updated Nov. 24, 2015, 4:29 p.m.)
> 
> 
> Review request for qpid, Justin Ross and Kenneth Giusti.
> 
> 
> Bugs: PROTON-1060
>     https://issues.apache.org/jira/browse/PROTON-1060
> 
> 
> Repository: qpid-proton-git
> 
> 
> Description
> -------
> 
> Several of the Python binding API calls for message properties do not use the correct types.  To align them properly with the AMQP 1.0 spec, the following APIs need changing:
> 
> Subject
> -------
> The spec for this is: <field name="subject" type="string"/>
> _get_subject() should return a unicode string, not a regular string;
> _set_subject() should accept a unicode string, not a regular string.
> 
> Content Type
> ------------
> The spec for this is: <field name="content-type" type="symbol"/>
> _get_content_type() should return a symbol, not a regular string;
> _set_content_type() should accept a symbol, not a regular string.
> 
> Content Encoding
> ----------------
> The spec for this is <field name="content-encoding" type="symbol"/>
> _get_content_encoding() should return a symbol, not a regular string;
> _set_content_encoding() should accept a symbol, not a regular string.
> 
> Group Id
> --------
> The spec for this is <field name="group-id" type="string"/>
> _get_group_id() should return a unicode string, not a regular string;
> _set_group_id() should accept a unicode string, not a regular string.
> 
> Reply-To Group Id
> -----------------
> The spec for this is <field name="reply-to-group-id" type="string"/>
> _get_reply_to_group_id() should return a unicode string, not a regular string;
> _set_reply_to_group_id() should accept a unicode string, not a regular string.
> 
> This patch makes the above changes to the API.
> 
> 
> Diffs
> -----
> 
>   proton-c/bindings/python/proton/__init__.py 2a87fe7b267589ad65a3eb26dc196406288dbbad 
>   tests/python/proton_tests/message.py 7aa9fac239ba6ee62e46588f855bb4e72d63a0e7 
> 
> Diff: https://reviews.apache.org/r/40648/diff/
> 
> 
> Testing
> -------
> 
> The tests proton_tests.message.AccessorsTest.testContentType and proton_tests.message.AccessorsTest.testContentEncoding were modified to use the new API type. The python tests pass.
> 
> This has been tested fairly extensively within qpid-interop-test, and works as it should.
> 
> 
> Thanks,
> 
> Kim van der Riet
> 
>