Skip to content
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): fix unknown attributes being ignored by mypy #1670

Merged
merged 1 commit into from Oct 31, 2022
Merged

fix(logger): fix unknown attributes being ignored by mypy #1670

merged 1 commit into from Oct 31, 2022

Conversation

nayaverdier
Copy link
Contributor

Issue number: #1660

Summary

Changes

Hides the __getattr__ function in Logger from mypy and other type checkers

User experience

Unknown attributes were not being flagged by mypy (e.g. logger.foobar() appeared as valid). Now, they appear as undefined attributes.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nayaverdier nayaverdier requested a review from a team as a code owner October 28, 2022 19:07
@nayaverdier nayaverdier requested review from heitorlessa and removed request for a team October 28, 2022 19:07
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 28, 2022
@github-actions github-actions bot added the bug Something isn't working label Oct 31, 2022
@heitorlessa
Copy link
Contributor

thank you so much @nayaverdier for the quick turnaround - Making this part of today's release :)

@heitorlessa heitorlessa merged commit 2798da1 into aws-powertools:develop Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static typing: Logger __getattr__ definition causes mypy to not error when missing an attribute
2 participants