-
Notifications
You must be signed in to change notification settings - Fork 421
feat(event-source): add function to get multi-value query string params by name #3846
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
feat(event-source): add function to get multi-value query string params by name #3846
Conversation
Thanks a lot @TonySherman for following through our Discord chat -- reviewing and merging this today |
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.
tiny changes to return a default instead of None
.
- Empty dict if you try to get all multi-value query strings params when there are none
- Empty list if you try to get a specific multi-value query string param that does not exist
The adjacent code has a tech debt we plan to pay in v3, where all Optional
will have empty defaults.. dict, lists, etc. So we can fix this one now as it's an addition
aws_lambda_powertools/utilities/data_classes/shared_functions.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/shared_functions.py
Outdated
Show resolved
Hide resolved
I'm gonna accept the changes as we need to make a patch release shortly before you're awake ;) |
Signed-off-by: Heitor Lessa <[email protected]>
Signed-off-by: Heitor Lessa <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #3846 +/- ##
===========================================
+ Coverage 96.38% 96.42% +0.04%
===========================================
Files 214 214
Lines 10030 10101 +71
Branches 1846 1866 +20
===========================================
+ Hits 9667 9740 +73
+ Misses 259 258 -1
+ Partials 104 103 -1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: heitorlessa <[email protected]>
|
Issue number: #3845
Summary
Changes
This adds a helper function to retrieve a list of multi-value query string params similar to the
get_query_string_value
function.User experience
Rather than getting the entire dictionary of multi-value parameters (
multi_value_query_string_parameters
), userscan get a single list of parameters by the name of the parameter.
event.get_multi_value_query_string_values(name='param', default_values=['value_1']
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.