Type boto3 clients and tables in exercises and solutions #18

Merged
nessar merged 3 commits from worktree-typed-exercises into main 2026-10-31 20:58:51 +01:00
Owner

Annotate the boto3 client and resource parameters of the exercises and their solutions with boto3-stubs types, so VS Code autocompletes methods and arguments.

  • boto3-stubs added as a dev dependency (pyproject.toml, uv.lock), for the 28 services the course uses.
  • Client parameters typed with their stub type (S3Client, SQSClient, DynamoDBClient, CognitoIdentityProviderClient…), DynamoDB tables with Table, the X-Ray recorder with AWSXRayRecorder. get_table() / make_dynamodb_client() get return types.
  • Lambda handler(event, context) and the test doubles (fake db, cache, clocks) are left untyped.
  • Tests sections unchanged.

Checks: awslings validate ✔ (83 exercises, 408 questions) · scripts/check_exercises.py 83/83 · pytest 113 passed.

Found while typing (not fixed here): the xray_1 solution calls subsegment.add_exception(exc), but the real X-Ray SDK signature is add_exception(exception, stack, remote=False). It passes only because the test fake accepts one argument.

🤖 Generated with Claude Code

Annotate the boto3 client and resource parameters of the exercises and their solutions with boto3-stubs types, so VS Code autocompletes methods and arguments. - `boto3-stubs` added as a dev dependency (`pyproject.toml`, `uv.lock`), for the 28 services the course uses. - Client parameters typed with their stub type (`S3Client`, `SQSClient`, `DynamoDBClient`, `CognitoIdentityProviderClient`…), DynamoDB tables with `Table`, the X-Ray recorder with `AWSXRayRecorder`. `get_table()` / `make_dynamodb_client()` get return types. - Lambda `handler(event, context)` and the test doubles (fake db, cache, clocks) are left untyped. - Tests sections unchanged. Checks: `awslings validate` ✔ (83 exercises, 408 questions) · `scripts/check_exercises.py` 83/83 · `pytest` 113 passed. Found while typing (not fixed here): the `xray_1` solution calls `subsegment.add_exception(exc)`, but the real X-Ray SDK signature is `add_exception(exception, stack, remote=False)`. It passes only because the test fake accepts one argument. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nessar added 3 commits 2026-10-31 20:58:38 +01:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Annotate client and resource parameters with boto3-stubs types (S3Client,
SQSClient, Table, ...) so VS Code autocompletes methods and arguments,
as in iam_3. Finished exercises (intro_1-2, iam_1-3) are left as the
learner wrote them. Tests sections are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The learner's branch already typed its own copy; this gives main's
untouched exercise the same signature as the solution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nessar merged commit 25d5c3727e into main 2026-10-31 20:58:51 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/awslings#18