Summary
This release improves logging incoming events that might be wrapped in common containers such as Event Source Data Classes, Pydantic/Parser BaseModels, and Dataclasses.
Also we addressed an issue when a header is set explicit to None.
Big thanks to @jasmarc for the bug report!
Example:
import json
from aws_lambda_powertools.event_handler import (
APIGatewayRestResolver,
Response,
)
app = APIGatewayRestResolver()
@app.get("/none")
def hello():
headers = {"This-Header-Will-Be-Omitted": None}
response = {"hello": "world"}
return Response(body=json.dumps(response), headers=headers, status_code=200)
def lambda_handler(event, context):
return app.resolve(event, context)
Changes
πNew features and non-breaking changes
- feat(logger): unwrap event from common models if asked to log (#1778) by @heitorlessa
π Documentation updates
- docs(validation): fix broken link; enrich built-in jmespath links (#1777) by @heitorlessa
- docs(idempotency): fix, improve, and increase visibility for batch integration (#1776) by @heitorlessa
π Bug and hot fixes
- fix(event_handlers): omit explicit None HTTP header values (#1793) by @leandrodamascena
π§ Maintenance
- chore(deps-dev): bump isort from 5.11.2 to 5.11.3 (#1788) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.54.0 to 2.55.1 (#1787) by @dependabot
- chore(deps-dev): bump mypy-boto3-cloudwatch from 1.26.17 to 1.26.30 (#1785) by @dependabot
- chore(deps-dev): bump isort from 5.10.1 to 5.11.2 (#1782) by @dependabot
- chore(deps-dev): bump pytest-asyncio from 0.20.2 to 0.20.3 (#1767) by @dependabot
- chore(deps): bump certifi from 2022.9.24 to 2022.12.7 (#1768) by @dependabot
- chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.13.post16 to 1.26.24 (#1765) by @dependabot
- chore(deps-dev): bump mypy-boto3-logs from 1.26.17 to 1.26.27 (#1775) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.53.0 to 2.54.0 (#1764) by @dependabot
- chore(deps-dev): bump flake8-bugbear from 22.10.27 to 22.12.6 (#1760) by @dependabot
- chore(deps-dev): bump filelock from 3.8.0 to 3.8.2 (#1759) by @dependabot
- chore(deps-dev): bump pytest-xdist from 3.0.2 to 3.1.0 (#1758) by @dependabot
- chore(deps-dev): bump mkdocs-material from 8.5.10 to 8.5.11 (#1756) by @dependabot
- chore(deps-dev): bump importlib-metadata from 4.13.0 to 5.1.0 (#1750) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 1.4.0 to 2.0.1 (#1752) by @dependabot
- chore(deps-dev): bump flake8-black from 0.3.3 to 0.3.5 (#1738) by @dependabot
- chore(deps-dev): bump mypy-boto3-cloudwatch from 1.26.0.post1 to 1.26.17 (#1753) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 1.3.0 to 1.4.0 (#1749) by @dependabot
This release was made possible by the following contributors:
@dependabot, @dependabot[bot], @heitorlessa, @leandrodamascena and Release bot