Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMQP Python] remove redundant sequence body normalization #29701

Open
swathipil opened this issue Mar 31, 2023 · 0 comments
Open

[AMQP Python] remove redundant sequence body normalization #29701

swathipil opened this issue Mar 31, 2023 · 0 comments
Assignees
Labels
AMQP Python Client This issue points to a problem in the data-plane of the library. Event Hubs Messaging Messaging crew Service Bus
Milestone

Comments

@swathipil
Copy link
Member

Currently, when converting an AmqpAnnotatedMessage with a sequence body, we "normalize" by wrapping the sequence body in a list. Then we iterate through the list when encoding the sequence body.

As per this discussion, we don't need to "normalize" since that's redundant.
TODO:

  1. Remove the "normalize_sequence_body" in the AmqpAnnotatedMessage constructor so that it's just:
elif "sequence_body" in kwargs:
            self._sequence_body = kwargs.get("sequence_body")
            self._body_type = AmqpMessageBodyType.SEQUENCE
  1. Remove the loop from the _pyamqp/_encode.py file when encoding sequence body so that it looks like:
if payload[6]:  # sequence
        encode_value(
            output,
            {
                TYPE: AMQPTypes.described,
                VALUE: (
                    {TYPE: AMQPTypes.ulong, VALUE: 0x00000076},
                    {TYPE: None, VALUE: payload[6]},
                ),
            },
        )
@swathipil swathipil added Service Bus Event Hubs Client This issue points to a problem in the data-plane of the library. Messaging Messaging crew AMQP Python labels Mar 31, 2023
@swathipil swathipil added this to the Backlog milestone Mar 31, 2023
@github-actions github-actions bot added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMQP Python Client This issue points to a problem in the data-plane of the library. Event Hubs Messaging Messaging crew Service Bus
Projects
None yet
Development

No branches or pull requests

3 participants