Skip to content

Static typing: Missing DeadLetterQueueSourceArn on SqsAttributesModel #4111

Closed
@amyc92

Description

@amyc92

Static type checker used

pyright/pylance

AWS Lambda function runtime

3.12

Powertools for AWS Lambda (Python) version

2.34.2

Static type checker info

VS Code, basic type checking enabled

Cannot access member "DeadLetterQueueSourceArn" for type "SqsAttributesModel"
  Member "DeadLetterQueueSourceArn" is unknownPylance[reportAttributeAccessIssue](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportAttributeAccessIssue)

Code snippet

from aws_lambda_powertools.utilities.parser.models import SqsModel
from aws_lambda_powertools.utilities.parser.parser import event_parser

@event_parser(model=SqsModel)
def handler(payload: SqsModel) -> str | None:
    return payload.Records[0].attributes.DeadLetterQueueSourceArn

Possible Solution

No response

Metadata

Metadata

Assignees

Labels

event_sourcesEvent Source Data Class utilityparserParser (Pydantic) utilitytypingStatic typing definition related issues (mypy, pyright, etc.)

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions