-
Notifications
You must be signed in to change notification settings - Fork 412
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
fix(logger): add explicit None return type annotations #3113
fix(logger): add explicit None return type annotations #3113
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
This revealed a few issues with mypy that didn't occur when I first checked the repo out: It looks as if the Now I'm guessing but the The second issue is that mypy now appears not to like the Again this seems like a case where we know better than mypy to me and it's not getting the full context as we know by definition (and the comment) that there will always be at least 3 frames. Are we happy with |
The former - I'd be happy with adding The main reason we didn't go with strict mode in Mypy is that it ended up causing more trouble than saving the effort. One item in the back of my mind is to take yet another look at Pyright -- it was better at these things, but I wasn't sure if it was going to be maintained long enough after all those years (it did!!). |
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #3113 +/- ##
===========================================
- Coverage 96.13% 96.11% -0.03%
===========================================
Files 186 186
Lines 8131 8131
Branches 1525 618 -907
===========================================
- Hits 7817 7815 -2
- Misses 252 253 +1
- Partials 62 63 +1
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending CI results -- lemme know otherwise if there's any other change.
Appreciate those extra comments and explicit ignore types 🫶
Making a release tomorrow
Kudos, SonarCloud Quality Gate passed!
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Released in 2.25.1 in PyPi. Building and optimizing Lambda Layers now -- should be all done in ~20m or so. Next Layer version being 45. |
Co-authored-by: Leandro Damascena <lcdama@amazon.pt> Co-authored-by: Heitor Lessa <lessa@amazon.com>
Issue number: #3112
Summary
Improves the type annotations in the
logging
module, specifically around those functions/methods that return None (with some bonus low hanging fruit elsewhere); solving the issue raised in #3112.However, this has revealed a few new typing issues that weren't present before; some of which were simple fixes so I have just made them. Others I have questions on how we want to handle which I will post as comments below.
Changes
Added explicit
-> None
return type annotations where appropriate in thelogging
moduleUser experience
Should mean that users using mypy in strict mode no longer have to suppress type errors on certain logging functions/methods
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
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.