Releases: aws-powertools/powertools-lambda-python
v2.10.0
Summary
This release brings support for parsing S3 Event Notifications via EventBridge and support for custom properties on the ActiveMQ event source data class.
⭐️ Huge thanks for our first-time contributors @alexaiss and @ivica-k, and also @tibbe for the typing hot-fix!
Parsing S3 event notifications via EventBridge
Amazon S3 can send event notifications with Amazon EventBridge. We added support for parsing those events in Lambda using the new S3EventNotificationEventBridgeModel
.
Thank you @robert-malai for capturing this feature gap!
Custom properties on ActiveMQ event
When integrating with Active MQ, Lambda supports JMS custom properties. After this change, you can also access them when using the ActiveMQ event source data class.
Changes
🌟New features and non-breaking changes
- feat(event_sources): support for custom properties in ActiveMQEvent (#1999) by @alexaiss
- feat(parser): support for S3 Event Notifications via EventBridge (#1982) by @ivica-k
📜 Documentation updates
- docs(metrics): fix high-resolution metrics announcement link (#2017) by @rubenfonseca
- feat(parser): support for S3 Event Notifications via EventBridge (#1982) by @ivica-k
- docs(homepage): revamp install UX & share how we build Lambda Layer (#1978) by @heitorlessa
🐛 Bug and hot fixes
- fix(build): auto-generate setup.py for legacy build tools (#2013) by @sthulb
- fix(typing): swap NoReturn with None for methods with no return value (#2004) by @tibbe
🔧 Maintenance
- chore(deps-dev): bump cfn-lint from 0.74.3 to 0.75.0 (#2020) by @dependabot
- chore(deps-dev): bump coverage from 7.2.1 to 7.2.2 (#2021) by @dependabot
- chore(deps-dev): bump filelock from 3.9.1 to 3.10.0 (#2019) by @dependabot
- fix(build): auto-generate setup.py for legacy build tools (#2013) by @sthulb
- chore(deps-dev): bump aws-cdk from 2.67.0 to 2.69.0 (#2010) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.1.2 to 9.1.3 (#2009) by @dependabot
- chore(deps-dev): bump cfn-lint from 0.74.2 to 0.74.3 (#2008) by @dependabot
- chore(deps-dev): bump filelock from 3.9.0 to 3.9.1 (#2006) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.68.0 to 2.69.0 (#2007) by @dependabot
- chore(deps-dev): bump cfn-lint from 0.74.1 to 0.74.2 (#2005) by @dependabot
- chore(deps-dev): bump mypy from 0.982 to 1.1.1 (#1985) by @dependabot
- chore(deps-dev): bump pytest-xdist from 3.2.0 to 3.2.1 (#2000) by @dependabot
- chore(deps-dev): bump flake8-bugbear from 23.2.13 to 23.3.12 (#2001) by @dependabot
- chore(deps-dev): bump bandit from 1.7.4 to 1.7.5 (#1997) by @dependabot
- chore(deps): bump docker/setup-buildx-action from 2.4.1 to 2.5.0 (#1995) by @dependabot
- chore(deps-dev): bump mypy-boto3-secretsmanager from 1.26.49 to 1.26.89 (#1996) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.1.1 to 9.1.2 (#1994) by @dependabot
- chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.84 to 1.26.87 (#1993) by @dependabot
- chore(deps): bump pydantic from 1.10.5 to 1.10.6 (#1991) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.67.0 to 2.68.0 (#1992) by @dependabot
- chore(deps-dev): bump cfn-lint from 0.74.0 to 0.74.1 (#1988) by @dependabot
- chore(deps): bump aws-actions/configure-aws-credentials from 1 to 2 (#1987) by @dependabot
- chore(deps-dev): bump pytest from 7.2.1 to 7.2.2 (#1980) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.1 to 2.1.2 (#1979) by @dependabot
- chore(deps-dev): bump types-python-dateutil from 2.8.19.9 to 2.8.19.10 (#1973) by @dependabot
- chore(deps-dev): bump hvac from 1.0.2 to 1.1.0 (#1983) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.1.0 to 9.1.1 (#1984) by @dependabot
- chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.24 to 1.26.84 (#1981) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.15 to 9.1.0 (#1976) by @dependabot
- chore(deps-dev): bump cfn-lint from 0.67.0 to 0.74.0 (#1974) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.66.1 to 2.67.0 (#1977) by @dependabot
This release was made possible by the following contributors:
@alexaiss, @dependabot, @dependabot[bot], @heitorlessa, @ivica-k, @rubenfonseca, @sthulb, @tibbe and Release bot
2.9.1
Summary
This patch release reverts a regression in Idempotency when using static_pk_value
for custom composite keys in DynamoDB Persistence Layer - huge thanks to @Tankanow for reporting and fixing it.
⭐ Big thanks to new contributors: @KeltonKarboviak on inconsistencies on Parameters docs (#1966), and @cibinmathew on upgrading GitHub Actions set-output
command in our workflows.
Changes
📜 Documentation updates
- docs(appsync): add mutation example and infrastructure fix (#1964) by @heitorlessa
- docs(parameters): fix typos and inconsistencies (#1966) by @KeltonKarboviak
🐛 Bug and hot fixes
🔧 Maintenance
- chore(parser): add workaround to make API GW test button work (#1971) by @heitorlessa
- chore(deps-dev): bump mypy-boto3-lambda from 1.26.55 to 1.26.80 (#1967) by @dependabot
- chore(ci): replace deprecated set-output commands (#1957) by @cibinmathew
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.0 to 2.1.1 (#1958) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.14 to 9.0.15 (#1959) by @dependabot
- chore(deps-dev): bump types-python-dateutil from 2.8.19.8 to 2.8.19.9 (#1960) by @dependabot
- chore(deps): bump fastjsonschema from 2.16.2 to 2.16.3 (#1961) by @dependabot
- chore(deps-dev): bump coverage from 7.2.0 to 7.2.1 (#1963) by @dependabot
- chore(deps-dev): bump types-requests from 2.28.11.14 to 2.28.11.15 (#1962) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.66.0 to 2.66.1 (#1954) by @dependabot
- chore(deps-dev): bump coverage from 7.1.0 to 7.2.0 (#1951) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.13 to 9.0.14 (#1952) by @dependabot
- chore(deps-dev): bump mypy-boto3-ssm from 1.26.43 to 1.26.77 (#1949) by @dependabot
- chore(deps): bump release-drafter/release-drafter from 5.22.0 to 5.23.0 (#1947) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.65.0 to 2.66.0 (#1948) by @dependabot
- chore(deps-dev): bump types-requests from 2.28.11.13 to 2.28.11.14 (#1946) by @dependabot
- chore(deps-dev): bump types-python-dateutil from 2.8.19.7 to 2.8.19.8 (#1945) by @dependabot
This release was made possible by the following contributors:
@KeltonKarboviak, @cibinmathew, @Tankanow, @dependabot, @dependabot[bot], @heitorlessa and Release bot
v2.9.0
Summary
This release contains a new feature on Batch Processing, along with enhancements and bug fixes to Logger and Feature Flags utilities.
⭐ Huge welcome to the new contributors: @royygael, @iago1460
SQS FIFO Batch Processing
You can now use SQS FIFO queues with the Batch Processing utility. We stop processing messages after the first failure and return all failed and unprocessed messages natively. This helps preserve the ordering of messages in your queue.
⭐ Thanks to @whoDoneItAgain for reporting this feature gap.
Logger improvements
We now allow exception
and exception_name
attributes as extra fields in all logging levels. Previously, we dropped those attributes in non-error logging levels (e.g: INFO
).
⭐ Thanks to @iago1460 for reporting this bug and submitting the fix!
New community content
Finally, we have two new community posts on Feature Flags from @ran-isenberg:
- How CyberArk uses Powertools to implement Feature Flags with AWS AppConfig: link
- A talk about the added value of using feature flags as part of your CI/CD process and how AWS Lambda Powertools can help: link
Changes
🌟New features and non-breaking changes
- feat(batch): add support to SQS FIFO queues (SqsFifoPartialProcessor) (#1934) by @rubenfonseca
📜 Documentation updates
- docs(we-made-this): add CI/CD using Feature Flags video (#1940) by @leandrodamascena
- feat(batch): add support to SQS FIFO queues (SqsFifoPartialProcessor) (#1934) by @rubenfonseca
- docs(event-handler): Fix REST API - HTTP Methods documentation (#1936) by @leandrodamascena
- docs(we-made-this): add Feature Flags post (#1939) by @leandrodamascena
🐛 Bug and hot fixes
- fix(metrics): clarify no-metrics user warning (#1935) by @rubenfonseca
- fix(logger): support exception and exception_name fields at any log level (#1930) by @iago1460
- fix(feature-flags): revert RuleAction Enum inheritance on str (#1910) by @royygael
🔧 Maintenance
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.0.5 to 2.1.0 (#1943) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.12 to 9.0.13 (#1944) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.64.0 to 2.65.0 (#1938) by @dependabot
- chore(deps-dev): bump types-python-dateutil from 2.8.19.6 to 2.8.19.7 (#1932) by @dependabot
- chore(deps-dev): bump types-requests from 2.28.11.12 to 2.28.11.13 (#1933) by @dependabot
- chore(deps): bump pydantic from 1.10.4 to 1.10.5 (#1931) by @dependabot
- chore(deps-dev): bump mypy-boto3-appconfig from 1.26.63 to 1.26.71 (#1928) by @dependabot
- chore(deps-dev): bump flake8-bugbear from 23.1.20 to 23.2.13 (#1924) by @dependabot
- chore(deps-dev): bump mypy-boto3-appconfigdata from 1.26.0.post1 to 1.26.70 (#1925) by @dependabot
This release was made possible by the following contributors:
@dependabot, @dependabot[bot], @heitorlessa, @iago1460, @leandrodamascena, @royygael, @rubenfonseca and Release bot
v2.8.0
Summary
This release is packed with new features and enhancements, specifically to Batch Processing, Metrics and Idempotency utility.
⭐ Huge welcome to new contributors: @BakasuraRCE, @prudnikov, @kavichu, @marcraminv
High-concurrency async processor
Thanks to @BakasuraRCE, we’re adding a new specialized processor for high concurrency jobs that can process thousands of messages sub-second (thanks to @sthulb for load testing) - AsyncBatchProcessor
and async_batch_processor
.
These will use Python’s asyncio.gather
to call your record handler with all records at the same time. During load testing, we’ve managed to process 5500 messages in approximately 300ms compared to 1.2 seconds with BatchProcessor
synchronous counterpart.
1-second resolution metrics
You can now create high-resolution (1s) metrics that are common for use cases like IoT, telemetry, time-series, real-time incident, etc. Previously, metrics were only created with 60-second resolution. This is an opt-in feature.
Inheriting dimensions in single_metric
Thanks to @prudnikov, you can now optionally set default dimensions for single metrics. These are individual application or operational metrics that despite being isolated from a larger set of metrics, they do share the same set of dimensions (avoid repetition, sparse metrics).
Idempotent_function decorator is now thread-safe
Thanks to @mploski, any Python function decorated with idempotent_function
can now safely be called from threads. Previously, we used to create higher-level AWS SDK clients which didn’t support threading - calling functions decorated back then could result in unforeseen side-effects.
Example
import os
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from threading import current_thread
from aws_lambda_powertools.utilities.idempotency import (
DynamoDBPersistenceLayer,
idempotent_function,
)
TABLE_NAME = os.getenv("IdempotencyTable", "")
persistence_layer = DynamoDBPersistenceLayer(table_name=TABLE_NAME)
threads_count = 2
@idempotent_function(persistence_store=persistence_layer, data_keyword_argument="record")
def record_handler(record):
time_now = time.time()
return {"thread_name": current_thread().name, "time": str(time_now)}
def lambda_handler(event, context):
with ThreadPoolExecutor(max_workers=threads_count) as executor:
futures = [executor.submit(record_handler, **{"record": event}) for _ in range(threads_count)]
return [
{"state": future._state, "exception": future.exception(), "output": future.result()}
for future in as_completed(futures)
]
Changes
🌟New features and non-breaking changes
- feat(batch): add async_batch_processor for concurrent processing (#1724) by @BakasuraRCE
- feat(metrics): add default_dimensions to single_metric (#1880) by @prudnikov
📜 Documentation updates
- docs(homepage): Replace poetry command to add group parameter (#1917) by @marcraminv
- feat(metrics) - add support for high resolution metrics (#1915) by @leandrodamascena
- feat(batch): add async_batch_processor for concurrent processing (#1724) by @BakasuraRCE
- fix(idempotency): make idempotent_function decorator thread safe (#1899) by @mploski
- docs(idempotency): add IAM permissions section (#1902) by @leandrodamascena
- docs(homepage): set url for end-of-support in announce block (#1893) by @kavichu
- feat(metrics): add default_dimensions to single_metric (#1880) by @prudnikov
🐛 Bug and hot fixes
🔧 Maintenance
- feat(batch): add async_batch_processor for concurrent processing (#1724) by @BakasuraRCE
- chore(deps-dev): bump mkdocs-material from 9.0.11 to 9.0.12 (#1919) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.63.2 to 2.64.0 (#1918) by @dependabot
- chore(pypi): add new links to Pypi package homepage (#1912) by @leandrodamascena
- chore(deps-dev): bump types-requests from 2.28.11.8 to 2.28.11.12 (#1906) by @dependabot
- chore(deps-dev): bump pytest-xdist from 3.1.0 to 3.2.0 (#1905) by @dependabot
- chore(deps): bump docker/setup-buildx-action from 2.4.0 to 2.4.1 (#1903) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.63.0 to 2.63.2 (#1904) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.10 to 9.0.11 (#1896) by @dependabot
- chore(deps-dev): bump mypy-boto3-appconfig from 1.26.0.post1 to 1.26.63 (#1895) by @dependabot
- docs(homepage): set url for end-of-support in announce block (#1893) by @kavichu
- chore(deps-dev): bump mkdocs-material from 9.0.9 to 9.0.10 (#1888) by @dependabot
- chore(deps-dev): bump mypy-boto3-s3 from 1.26.58 to 1.26.62 (#1889) by @dependabot
- chore(deps-dev): bump black from 22.12.0 to 23.1.0 (#1886) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.62.2 to 2.63.0 (#1887) by @dependabot
This release was made possible by the following contributors:
@BakasuraRCE, @dependabot, @dependabot[bot], @heitorlessa, @kavichu, @leandrodamascena, @marcraminv, @mploski, @prudnikov and Release bot
v2.7.1
Summary
This patch release addresses three areas:
Big welcome to our new contributors: @ashutoshojha5, @meckhardt
- Licensing. PyPi/Poetry license correction to
MIT No Attribution
(previouslyMIT-0
was unrecognized) - huge thanks to @meckhardt. - Documentation. Recreates 42 code snippets in the Parameters documentation to be more realistic, formatted, and linted as part of our larger campaign. It also corrects a CloudWatch Logs code snippet in the Event Source Data Classes documentation - thanks to @ashutoshojha5!
- End of support for v1. We formally set March 31st as our last day to support new bugfixes to V1, and recommend customers to follow our Upgrade Guide.
Changes
📜 Documentation updates
- docs(homepage): add banner for end-of-support v1 (#1879) by @leandrodamascena
- docs(parameters): snippets split, improved, and lint (#1564) by @leandrodamascena
- docs(event-source): fix incorrect method in example CloudWatch Logs (#1857) by @ashutoshojha5
🐛 Bug and hot fixes
- fix(license): correction to MIT + MIT-0 (no proprietary anymore) (#1883) by @meckhardt
- fix(ci): add auth to API HTTP Gateway and Lambda Function Url (#1882) by @rubenfonseca
- fix(license): add MIT-0 license header (#1871) by @meckhardt
- fix(tests): make logs fetching more robust (#1878) by @rubenfonseca
- fix(tests): make sure multiple e2e tests run concurrently (#1861) by @rubenfonseca
🔧 Maintenance
- fix(license): correction to MIT + MIT-0 (no proprietary anymore) (#1883) by @meckhardt
- fix(ci): add auth to API HTTP Gateway and Lambda Function Url (#1882) by @rubenfonseca
- fix(license): add MIT-0 license header (#1871) by @meckhardt
- chore(deps-dev): bump flake8-bugbear from 22.12.6 to 23.1.20 (#1854) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.6 to 9.0.8 (#1874) by @dependabot
- chore(deps): bump docker/setup-buildx-action from 2.0.0 to 2.4.0 (#1873) by @dependabot
- chore(deps-dev): bump isort from 5.11.4 to 5.11.5 (#1875) by @dependabot
- fix(tests): make sure multiple e2e tests run concurrently (#1861) by @rubenfonseca
- chore(deps-dev): bump aws-cdk-lib from 2.62.1 to 2.62.2 (#1869) by @dependabot
- chore(deps-dev): bump mypy-boto3-s3 from 1.26.0.post1 to 1.26.58 (#1868) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.62.0 to 2.62.1 (#1866) by @dependabot
- chore(deps-dev): bump mypy-boto3-cloudformation from 1.26.35.post1 to 1.26.57 (#1865) by @dependabot
- chore(deps-dev): bump coverage from 7.0.5 to 7.1.0 (#1862) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.61.1 to 2.62.0 (#1863) by @dependabot
- chore(deps): bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 (#1855) by @dependabot
- chore(deps-dev): bump mypy-boto3-lambda from 1.26.49 to 1.26.55 (#1856) by @dependabot
This release was made possible by the following contributors:
@ashutoshojha5, @dependabot, @dependabot[bot], @leandrodamascena, @meckhardt, @rubenfonseca and Release bot
v2.7.0
Summary
This release adds support for time-based Feature Flags, and simplified support for returning a custom HTTP status code on the event handler.
Feature Flags
This release enhanced the Feature Flags utility with a new time-based feature. You can now enable certain features in your application during the weekends, at a certain period or day, across one or more time zones. Big thanks to @ran-isenberg! Check out this sample that enables a feature on weekends in NYC TZ:
Event Handler
We also have a nice addition to our event handler utility. You can now add a second return argument if you want to customize the returned HTTP status code. ⭐ Big thanks to @theoutsider24 for your first contribution! ⭐
Changes
🌟New features and non-breaking changes
- feat(feature_flags): Add Time based feature flags actions (#1846) by @ran-isenberg, @rubenfonseca
- feat(event_handlers) Add support for returning dict, status-code tuples from resolvers (#1853) by @theoutsider24
📜 Documentation updates
- feat(feature_flags): Add Time based feature flags actions (#1846) by @ran-isenberg
🔧 Maintenance
- chore(deps-dev): bump mkdocs-material from 9.0.5 to 9.0.6 (#1851) by @dependabot
- chore(deps-dev): bump mypy-boto3-logs from 1.26.49 to 1.26.53 (#1850) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.60.0 to 2.61.1 (#1849) by @dependabot
- chore(deps-dev): bump mypy-boto3-cloudwatch from 1.26.30 to 1.26.52 (#1847) by @dependabot
- feat(feature_flags): Add Time based feature flags actions (#1846) by @leandrodamascena
- chore(deps-dev): bump types-requests from 2.28.11.7 to 2.28.11.8 (#1843) by @dependabot
- chore(deps): bump peaceiris/actions-gh-pages from 3.9.1 to 3.9.2 (#1841) by @dependabot
- chore(deps-dev): bump pytest from 7.2.0 to 7.2.1 (#1838) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.4 to 9.0.5 (#1840) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.0.4 to 2.0.5 (#1837) by @dependabot
- chore(deps): bump future from 0.18.2 to 0.18.3 (#1836) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.3 to 9.0.4 (#1833) by @dependabot
- chore(deps-dev): bump mypy-boto3-logs from 1.26.43 to 1.26.49 (#1834) by @dependabot
- chore(deps-dev): bump mypy-boto3-secretsmanager from 1.26.40 to 1.26.49 (#1835) by @dependabot
- chore(deps-dev): bump mypy-boto3-lambda from 1.26.18 to 1.26.49 (#1832) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.59.0 to 2.60.0 (#1831) by @dependabot
This release was made possible by the following contributors:
@dependabot, @dependabot[bot], @leandrodamascena, @ran-isenberg, @rubenfonseca, @theoutsider24 and Release bot
v2.6.0
Summary
In this release, we added new specialised routers for all supported event handlers. This way you'll get type hints from your IDE as you access the current_event
property.
We also improved the exception logging in the idempotency utility with additional context taken from the raised downstream exception.
⭐ Finally, we thank our two new contributors @aidansteele and @pawosty for helping us iron out some important bugs! ⭐
Changes
🌟New features and non-breaking changes
- (feat): introduce specialized routers for typing (#1824) by @rubenfonseca
📜 Documentation updates
- docs(logger): fix incorrect field names in example structured logs (#1830) by @aidansteele
- feat(event_handler): introduce specialized routers for typing (#1824) by @rubenfonseca
- docs(logger): Add warning of uncaught exceptions (#1826) by @leandrodamascena
🐛 Bug and hot fixes
- fix(idempotency): Log nested exception message (#1813) by @mploski
- fix(api_gateway): fixed custom metrics issue when using debug mode (#1827) by @pawosty
🔧 Maintenance
- chore(deps-dev): bump coverage from 7.0.4 to 7.0.5 (#1829) by @dependabot
- chore(deps-dev): bump mkdocs-material from 9.0.2 to 9.0.3 (#1823) by @dependabot
- chore(deps-dev): bump coverage from 7.0.3 to 7.0.4 (#1822) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.0.3 to 2.0.4 (#1821) by @dependabot
- chore(deps-dev): bump ijson from 3.1.4 to 3.2.0.post0 (#1815) by @dependabot
- chore(deps): bump peaceiris/actions-gh-pages from 3.9.0 to 3.9.1 (#1814) by @dependabot
- chore(deps): bump pydantic from 1.10.2 to 1.10.4 (#1817) by @dependabot
- chore(deps-dev): bump mypy-boto3-ssm from 1.26.11.post1 to 1.26.43 (#1819) by @dependabot
- chore(deps-dev): bump mypy-boto3-logs from 1.26.27 to 1.26.43 (#1820) by @dependabot
- chore(deps-dev): bump filelock from 3.8.2 to 3.9.0 (#1816) by @dependabot
- chore(deps-dev): bump mypy-boto3-cloudformation from 1.26.11.post1 to 1.26.35.post1 (#1818) by @dependabot
- chore(deps-dev): bump mkdocs-material from 8.5.11 to 9.0.2 (#1808) by @dependabot
- chore(deps-dev): bump coverage from 6.5.0 to 7.0.3 (#1806) by @dependabot
- chore(deps-dev): bump flake8-builtins from 2.0.1 to 2.1.0 (#1799) by @dependabot
- chore(deps): bump gitpython from 3.1.29 to 3.1.30 (#1812) by @dependabot
- chore(deps-dev): bump mypy-boto3-secretsmanager from 1.26.12 to 1.26.40 (#1811) by @dependabot
- chore(deps-dev): bump isort from 5.11.3 to 5.11.4 (#1809) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.55.1 to 2.59.0 (#1810) by @dependabot
- chore(deps-dev): bump importlib-metadata from 5.1.0 to 6.0.0 (#1804) by @dependabot
- chore(deps): bump release-drafter/release-drafter from 5.21.1 to 5.22.0 (#1802) by @dependabot
- chore(deps-dev): bump black from 22.10.0 to 22.12.0 (#1770) by @dependabot
- chore(deps-dev): bump flake8-black from 0.3.5 to 0.3.6 (#1792) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.0.1 to 2.0.3 (#1801) by @dependabot
- chore(deps-dev): bump types-requests from 2.28.11.5 to 2.28.11.7 (#1795) by @dependabot
This release was made possible by the following contributors:
@aidansteele, @dependabot, @dependabot[bot], @leandrodamascena, @mploski, @pawosty, @rubenfonseca and Release bot
v2.5.0
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
v2.4.0
Summary
This release introduces a brand new streaming utility to handle datasets larger than the available memory.
This addresses scenarios where you want to process Amazon S3 objects as seekable data streams, with minimal memory consumption.
Built-in data transformations
We've added support for popular data transformations to decompress and deserialize data (gzip, CSV and ZIP). This way you can transform the data while streaming, and only use the minimum amount of memory necessary.
Bring your own data transformation
You can also create your own data transformations and add them to the pipeline. For example, here's how to use the ijson
library to parse JSON as a data stream:
We plan to support more data transformations in the future too!
🌟 Would you like to see a specific data transformation supported in Powertools? Drop us a line in the python channel of our Discord.
Changes
🌟New features and non-breaking changes
- feat(streaming): add new s3 streaming utility (#1719) by @rubenfonseca
📜 Documentation updates
- docs(idempotency): fix register_lambda_context order (#1747) by @heitorlessa
- feat(streaming): add new s3 streaming utility (#1719) by @rubenfonseca
🔧 Maintenance
- feat(streaming): add new s3 streaming utility (#1719) by @rubenfonseca
- chore(deps-dev): bump mypy-boto3-cloudformation from 1.26.0.post1 to 1.26.11.post1 (#1746) by @dependabot
- chore(deps-dev): bump mypy-boto3-lambda from 1.26.0.post1 to 1.26.12 (#1742) by @dependabot
- chore(deps-dev): bump aws-cdk-lib from 2.50.0 to 2.51.1 (#1741) by @dependabot
- chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.0.post1 to 1.26.13.post16 (#1743) by @dependabot
- chore(deps-dev): bump mypy-boto3-secretsmanager from 1.26.0.post1 to 1.26.12 (#1744) by @dependabot
- chore(deps-dev): bump mypy-boto3-ssm from 1.26.4 to 1.26.11.post1 (#1740) by @dependabot
- chore(deps-dev): bump types-requests from 2.28.11.4 to 2.28.11.5 (#1729) by @dependabot
- chore(deps): bump aws-xray-sdk from 2.10.0 to 2.11.0 (#1730) by @dependabot
- chore(deps-dev): bump mkdocs-material from 8.5.9 to 8.5.10 (#1731) by @dependabot
This release was made possible by the following contributors:
@dependabot, @dependabot[bot], @heitorlessa, @rubenfonseca and Release bot
v2.3.1
Summary
This patch release address an issue in Event Handler REST API to support dynamic routes with an equal sign (=
).
Big thanks to @baraksalomon for the bug report!
Previously, a dynamic route containing =
would result in a not found response (HTTP 404).
Example
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.utilities.typing import LambdaContext
app = APIGatewayRestResolver()
# NOTE: `/token/bXl0b2tlbg==` should be matched and not return 404 now
@app.get("/token/<token>")
def get_token(token: str):
return {"received": f"{token}"}
def lambda_handler(event: dict, context: LambdaContext) -> dict:
return app.resolve(event, context)
Changes
🐛 Bug and hot fixes
- fix(apigateway): support dynamic routes with equal sign (RFC3986) (#1737) by @heitorlessa
🔧 Maintenance
- chore(deps-dev): bump mypy-boto3-xray from 1.26.9 to 1.26.11.post1 (#1734) by @dependabot
This release was made possible by the following contributors:
@dependabot, @dependabot[bot], @heitorlessa and Release bot