Skip to content

Conversation

@leandrodamascena
Copy link
Contributor

Closes #255

Description of changes:

I added boto3-stubs[lambda] as a dev dependency for type checking. The boto3 client is now typed as Boto3LambdaClient and API responses use the proper TypeDefs to make it type safe.

boto3-stubs[lambda] downloads - https://pypistats.org/packages/mypy-boto3-lambda

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

**params
optional_params["ClientToken"] = client_token

result: CheckpointDurableExecutionResponseTypeDef = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be very tempted to keep this MutableMapping[str, Any] instead of CheckpointDurableExecutionResponseTypeDef - we're immediately serializing the result into a custom dataclass from a dict, and this way we avoid the extra cast..

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since cast() has virtually zero runtime cost - it just returns the value unchanged, purely a type checker hint - I'd keep the specific TypeDefs.

I see some trends about Python ecosystem is moving towards more stricter typing, and mypy isn't the only option anymore. We now have ty from Astral (the ruff folks) which is gaining traction. Using precise types now means we're better positioned as the tooling improves.

Personally I'd keep it, but happy to revert.

CheckpointToken=checkpoint_token,
Marker=next_marker,
MaxItems=max_items,
result: GetDurableExecutionStateResponseTypeDef = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar here on MutableMapping

@yaythomas yaythomas merged commit f835016 into main Jan 14, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: add type checking stubs dev dependencies

2 participants