-
Notifications
You must be signed in to change notification settings - Fork 402
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
RFC: Including the Typing returns in Metrics #642
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hey @mkamioner, we absolutely agree and if you could help us make MyPy compliant we'd appreciate it immensely! We've fixed roughly 600 of the initial MyPy findings[1].... there's still 35+ from my last count to be fixed (Metrics included). |
hey @mkamioner - While I couldn't reproduce that particular error with Metrics (a snippet would be great), I've gone ahead and added return types In the overall project we've now got 13 mypy issues to fix but that should in theory address your problem in the next release. Thanks! |
This is now available as part of 1.21.0, do let us know otherwise (and if you do, please share a snippet and mypy config to help us reproduce) https://github.com/awslabs/aws-lambda-powertools-python/releases/tag/v1.21.0 |
Key information
Summary
The Metrics library does not include the return types of the functions, causing MyPy to complain.
Motivation
Adding typing to the return of the signature of the function will help prevent errors during development. Also, Mypy will stop complaining:
Proposal
Go through the metrics/metrics.py file and add the return type to all functions
User Experience
This would require no code change and be backwards compatible. Users would get a better result from mypy and type hinting tools to help makde development easier
Before
After
Drawbacks
Honestly, none that I can think of except for someone's time - happy to take care of that :-)
Rationale and alternatives
Unresolved questions
The text was updated successfully, but these errors were encountered: