Replace LambdaContext class with a Proto and a dataclass#54
Merged
2 commits merged intoOct 16, 2025
Merged
Conversation
yaythomas
requested changes
Oct 15, 2025
| cognito_identity=cognito_identity_dict, | ||
| epoch_deadline_time_in_ms=int( | ||
| return { | ||
| "invoke_id": "test-invoke-12345", |
Contributor
There was a problem hiding this comment.
per review here, https://github.com/aws/aws-durable-execution-sdk-python-testing/pull/54/files
this is a class, not a dict.
maybe make a lightweight dataclass here just for the Testing Lib that incorporate the protocol?
from sdk import LambdaContext as LambdaContextProtocol
@dataclass
class LambdaContext(LambdaContextProtocol):
aws_request_id: str
log_group_name: str | None = None
log_stream_name: str | None = None
function_name: str | None = None
memory_limit_in_mb: str | None = None
function_version: str | None = None
invoked_function_arn: str | None = None
tenant_id: str | None = None
client_context: object | None = None
identity: object | None = None
def get_remaining_time_in_millis(self) -> int:
return 0 # Implementation needed
def log(self, msg: str) -> None:
print(msg) # Implementation needed
Author
There was a problem hiding this comment.
Edit: Clarified offline. Will use class instead.
Signed-off-by: Astraea Sinclair <quinsclr@amazon.com>
bchampp
approved these changes
Oct 16, 2025
rarepolz
approved these changes
Oct 16, 2025
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces previous uses of LambdaContext with a dataclass that implements the proto from sdk repo.
Dependencies
If this PR requires testing against a specific branch of the Python Language SDK (e.g., for unreleased changes), uncomment and specify the branch below. Otherwise, leave commented to use the main branch.
PYTHON_LANGUAGE_SDK_BRANCH: lambda-ctx
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.