Skip to content

Tech debt: Centralize DictWrapper functions for query, header, json_data, etc. #2424

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

Closed
1 of 2 tasks
heitorlessa opened this issue Jun 8, 2023 · 2 comments · Fixed by #2496
Closed
1 of 2 tasks

Tech debt: Centralize DictWrapper functions for query, header, json_data, etc. #2424

heitorlessa opened this issue Jun 8, 2023 · 2 comments · Fixed by #2496
Labels
event_sources Event Source Data Class utility tech-debt Technical Debt tasks

Comments

@heitorlessa
Copy link
Contributor

Why is this needed?

API Gateway (REST, HTTP), ALB, Lambda Function URL, and VPC Lattice unfortunately have differences in the payload. This leads to having nearly the same functionality in Event Source Data Classes to work around these differences and limitations.

These will eventually lead to a drift in implementation, making it harder to debug.

Latest example: https://github.com/awslabs/aws-lambda-powertools-python/pull/2358/files#diff-209f210ae09d053ce73d291e9f7b3869015b7f592f186be386518f152aa497adR56

Which area does this relate to?

Event Source Data Classes

Suggestion

Within aws_lambda_powertools/utilities/data_classes/common.py, we could have standalone functions like get_header_value, and create new ones to handle JSON and Base64 deserialization.

This means updating code in several places where we might have HTTP Headers, HTTP Query Strings, HTTP JSON payload, Base64 payload -- SNS, SQS, Kinesis, API Gateway, AppSync, etc.

Acknowledgment

@heitorlessa heitorlessa added triage Pending triage from maintainers tech-debt Technical Debt tasks event_sources Event Source Data Class utility and removed triage Pending triage from maintainers labels Jun 8, 2023
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Jun 20, 2023
@github-project-automation github-project-automation bot moved this from Triage to Working on it in Powertools for AWS Lambda (Python) Jun 20, 2023
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@leandrodamascena leandrodamascena moved this from Working on it to Coming soon in Powertools for AWS Lambda (Python) Jun 20, 2023
@github-actions
Copy link
Contributor

This is now released under 2.18.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Jun 23, 2023
@leandrodamascena leandrodamascena moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_sources Event Source Data Class utility tech-debt Technical Debt tasks
Projects
Status: Shipped
2 participants