Skip to content

Bug: SQSMessageAttributes __getitem__ has a different type to items() values #3880

Closed
@palfrey

Description

@palfrey

Expected Behaviour

I'd expect the value of items() calls to equal the values from __getitem__

Current Behaviour

You get SQSMessageAttribute from __getitem__ and (str, Any) Tuples from items

Code snippet

attributes = SQSMessageAttributes({"key":{"stringValue":"value", "dataType":"String"}})

assert attributes.items()[0][0] != attributes[attributes.key()]

Possible Solution

Either rewrite on the way in, or override items.

Steps to Reproduce

attributes = SQSMessageAttribute({"key":{"stringValue":"value", "dataType":"String"}})

assert attributes.items()[0][0] != attributes[attributes.key()]

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.8

Packaging format used

PyPi

Debugging logs

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions