-
Notifications
You must be signed in to change notification settings - Fork 421
Bug: Python 3.10 :: SQSEvent :: AttributeError: 'dict' object has no attribute 'records' #4919
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hi @CloutKhan! Thanks for opening this issue. This is actually not a bug, what is happening here is because you are using from aws_lambda_powertools.utilities.data_classes import event_source, SQSEvent
from aws_lambda_powertools.utilities.typing import LambdaContext
@event_source(data_class=SQSEvent)
def lambda_handler(event: SQSEvent, context: LambdaContext):
for record in event.records: # where event["Records"] does not fail.
pass thanks |
Please reopen this issue if you need any further support @CloutKhan! Closing as not a bug. |
|
Expected Behaviour
events.records
can be used as the iterator over records.Current Behaviour
AttributeError: 'dict' object has no attribute 'records'
Code snippet
Possible Solution
No response
Steps to Reproduce
Try to access
event.records
as a property on anSQSEvent
instance.Powertools for AWS Lambda (Python) version
2.42.0
AWS Lambda function runtime
3.10
Packaging format used
Lambda Layers
Debugging logs
No response
The text was updated successfully, but these errors were encountered: