-
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(metrics): support additional arguments in functions wrapped with log_metrics decorator #3120
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
Kudos, SonarCloud Quality Gate passed! |
@thegeorgeliu thank you so much for taking the time to report and send a fix (with tests!). We'll include it in tomorrows release. |
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #3120 +/- ##
===========================================
- 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. |
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. |
…log_metrics decorator (#3120)
Issue number: #3119
Summary
Changes
Allow a function wrapped by the
@metrics.log_metrics
decorator to accept arguments besides the event and lambda context. Thedecorate()
function now takes in*args
and**kwargs
as arguments and then passes them to thelambda_handler()
call.User experience
Previously, the user would experience a "wrong number of positional arguments" or "unexpected keyword argument" TypeError when attempting to call a function wrapped by the decorator (e.g. lambda handler) with additional arguments.
After this change, the user is able to successfully pass additional arguments, positional or keyword, to the wrapped function without raising any errors.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
No, this is not a breaking change.
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.