github aws-powertools/powertools-lambda-python v3.34.0

4 hours ago

Summary

We're really happy to say the Circuit Breaker utility is now GA. It shipped as alpha in 3.31.0 to collect real-world feedback, and that's exactly what happened, so it's time to drop the _alpha suffix and call it stable.

A big thank you to everyone who used it, reported issues and sent fixes during the alpha. It's in much better shape because of you.

Circuit Breaker is now GA

Docs

The only change you need to make is the import path. circuit_breaker_alpha becomes circuit_breaker:

from aws_lambda_powertools.utilities.circuit_breaker import circuit_breaker
from aws_lambda_powertools.utilities.circuit_breaker.persistence import (
    CircuitBreakerDynamoDBPersistence,
)
from aws_lambda_powertools.utilities.typing import LambdaContext

persistence = CircuitBreakerDynamoDBPersistence(table_name="CircuitBreakerState")


@circuit_breaker(name="payment-backend", persistence_store=persistence)
def charge(order: dict) -> dict:
    return payment_api.charge(order)


def lambda_handler(event: dict, context: LambdaContext) -> dict:
    return charge(event)

Everything else stays the same. Same API, same defaults (open after 5 consecutive failures, probe after 30 seconds, close after 3 probe successes), same behaviour. If you were using it during the alpha, update the import and you're done.

A note on 3.32.0 and 3.33.0

You'll notice we jumped from 3.31.1 straight to 3.34.0. Nothing to worry about: our release pipeline accidentally skipped 3.32.0 and 3.33.0, so they were never built or published. No package went to PyPI and no Lambda layer was published for either of them, so there's no impact for anyone. Everything that was meant to go out in those two releases is included here in 3.34.0.

Changes

  • fix(event_handler): omit Content-Type header from OpenAPI (#8374) by @DebadityaHait
  • fix(tracer): declare in_subsegment_async as an async context manager (#8367) by @vishwakt

📜 Documentation updates

🔧 Maintenance

This release was made possible by the following contributors:

@DebadityaHait, @leandrodamascena, @vishwakt and @dependabot[bot]

Don't miss a new powertools-lambda-python release

NewReleases is sending notifications on new releases.