fix(event_source): mypy strict mode compliance#8332
Conversation
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8332 +/- ##
===========================================
- Coverage 96.63% 96.63% -0.01%
===========================================
Files 296 296
Lines 14759 14764 +5
Branches 1243 1244 +1
===========================================
+ Hits 14263 14267 +4
Misses 362 362
- Partials 134 135 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
leandrodamascena
left a comment
There was a problem hiding this comment.
Amazing work @stenczelt! Thanks a lot, APPROVED!
a9fce32
into
aws-powertools:develop
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |



Issue number: closes #8331
Summary
Changes
aws_lambda_powertools.utilities.data_classes.event_sourcecomplies withmypyin--strictmode as well.Removed a redundant casting to the dataclass in
examples/event_sources/src/kinesis_firehose_response_exception.py.Changes are localised to
event_source.py, rather than trying to annotatelambda_handler_decoratorfor all use cases, unlike earlier attempts, e.g. #4165. Since the decorator only takes the dataclass as a keyword argument, I've defined a protocol and cast the result to this.User experience
Having a handler using the
@event_sourcedecorator, inmain.pyBefore:
After:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.