Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump aws-lambda-powertools[parser] from 2.41.0 to 3.5.0 #293

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 28, 2025

Bumps aws-lambda-powertools[parser] from 2.41.0 to 3.5.0.

Release notes

Sourced from aws-lambda-powertools[parser]'s releases.

v3.5.0

Summary

We're excited to introduce new features and improvements in this release:

  • We have added new Event Source Data Classes for AWS Transfer Family
  • Idempotency feature with support for custom key prefixes
  • Context manager for logger keys, offering more flexible logging options

We also revamped the Data Source event class documentation and now we have more complete examples.

Thanks to @​xdxindustries for helping us resolve a bug with OpenAPI and Pydantic Models' forward references.

⭐ Huge thanks to our new contributors: @​kattakaha and @AlphaWong!

Working with AWS Transfer Family events

Docs

We've introduced new Event Source Data Classes to simplify custom identity provider authorizations in AWS Transfer Family, streamlining the process of constructing authorization responses for Lambda-based custom authorizers.

  • TransferFamilyAuthorizer: Converts incoming events into structured objects
  • TransferFamilyAuthorizerResponse: Facilitates building standardized authorization responses

image

Custom Idempotency Key Prefix Support

Docs

The @idempotent_function and @idempotent decorators now support an optional key_prefix parameter, allowing you to define custom prefixes for idempotency keys. With this feature, you can implement cross-function idempotency, group related operations under a common prefix, and ensure your idempotency records remain stable during code refactoring or Lambda function renaming.

It allows you to override the default idempotency key prefix, which is typically a combination of Lambda function, module, and decorated function names. By specifying a custom prefix, you gain more control over the idempotency key structure.

image

Context Manager for Logger Keys

Docs

The Logger utility now includes an append_context_keys context manager, allowing temporary addition of keys to the logger’s context within a with statement. This simplifies the process of adding contextual information to logs in specific code blocks.

image

Changes

... (truncated)

Changelog

Sourced from aws-lambda-powertools[parser]'s changelog.

Unreleased

Bug Fixes

  • event_handler: fixes typo in variable name fronzen_openapi_extensions (#5929)
  • event_handler: add tests for PEP 563 compatibility with OpenAPI (#5886)
  • event_handler: fix forward references resolution in OpenAPI (#5885)
  • parser: make identitySource optional for ApiGatewayAuthorizerRequestV2 model (#5880)

Documentation

  • data_classes: improve Event Source Data Classes documentation (#5916)
  • event_handler: demonstrate handling optional security routes (#5895)
  • layer: update layer version number - v3.4.1 (#5869)
  • parser: improve documentation with Pydantic best practices (#5925)

Features

  • event_source: add AWS Transfer Family classes (#5912)
  • idempotency: add support for custom Idempotency key prefix (#5898)
  • logger: add context manager for logger keys (#5883)
  • parser: add AWS Transfer Family model (#5906)

Maintenance

  • ci: adjust token permission (#5867)
  • ci: new pre-release 3.4.2a0 (#5873)
  • ci: make pyproject.toml fully compatible with Poetryv2 (#5902)
  • ci: fix permissions for gh pages (#5866)
  • ci: drop support for Python 3.8 (#5896)
  • deps: bump squidfunk/mkdocs-material from ba73db5 to 41942f7 in /docs (#5890)
  • deps: bump pydantic from 2.10.5 to 2.10.6 (#5918)
  • deps-dev: bump cfn-lint from 1.22.5 to 1.22.6 (#5900)
  • deps-dev: bump cfn-lint from 1.22.6 to 1.22.7 (#5910)
  • deps-dev: bump testcontainers from 3.7.1 to 4.9.1 (#5907)
  • deps-dev: bump pytest-benchmark from 4.0.0 to 5.1.0 (#5909)
  • deps-dev: bump ruff from 0.9.2 to 0.9.3 (#5911)
  • deps-dev: bump pytest-cov from 5.0.0 to 6.0.0 (#5908)
  • deps-dev: bump pytest-asyncio from 0.24.0 to 0.25.2 (#5920)
  • deps-dev: bump boto3-stubs from 1.36.4 to 1.36.5 (#5919)
  • deps-dev: bump boto3-stubs from 1.36.4 to 1.36.6 (#5923)
  • deps-dev: bump boto3-stubs from 1.36.2 to 1.36.3 (#5894)
  • deps-dev: bump aws-cdk from 2.176.0 to 2.177.0 (#5930)
  • deps-dev: bump mkdocs-material from 9.5.49 to 9.5.50 (#5889)
  • deps-dev: bump aws-cdk-aws-lambda-python-alpha from 2.175.1a0 to 2.176.0a0 (#5882)
  • deps-dev: bump boto3-stubs from 1.36.1 to 1.36.2 (#5881)

... (truncated)

Upgrade guide

Sourced from aws-lambda-powertools[parser]'s upgrade guide.


title: Upgrade guide description: Guide to update between major Powertools for AWS Lambda (Python) versions

Migrate to v3 from v2

!!! info "We strongly encourage you to migrate to v3. However, if you still need to upgrade from v1 to v2, you can find the upgrade guide."

We've made minimal breaking changes to make your transition to v3 as smooth as possible.

Quick summary

Area Change Code change required
Pydantic We have removed support for Pydantic v1 No
Parser We have replaced DynamoDBStreamModel AttributeValue with native Python types Yes
Parser We no longer export Pydantic objects from parser.pydantic. Yes
Lambda layer Lambda layers are now compiled according to the specific Python version and architecture No
Event Handler We have deprecated the get_header_value function. Yes
Batch Processor @batch_processor and @async_batch_processor decorators are now deprecated Yes
Event Source Data Classes We have updated default values for optional fields. Yes
Parameters The default cache TTL is now set to 5 minutes No
Parameters The config parameter is deprecated in favor of boto_config Yes
JMESPath Functions The extract_data_from_envelope function is deprecated in favor of query Yes
Types file We have removed the type imports from the shared/types.py file Yes

First Steps

Before you start, we suggest making a copy of your current working project or create a new branch with git.

  1. Upgrade Python to at least v3.9.
  2. Ensure you have the latest version via Lambda Layer or PyPi{target="_blank"}.
  3. Review the following sections to confirm if you need to make changes to your code.

Drop support for Pydantic v1

!!! note "No code changes required"

As of June 30, 2024, Pydantic v1 has reached its end-of-life, and we have discontinued support for this version. We now exclusively support Pydantic v2.

Use Pydantic v2 Migration Guide{target="_blank"} to migrate your custom Pydantic models to v2.

DynamoDBStreamModel in parser

!!! info "This also applies if you're using DynamoDB BatchProcessor{target="_blank"}."

DynamoDBStreamModel now returns native Python types when you access DynamoDB records through Keys, NewImage, and OldImage attributes.

... (truncated)

Commits
  • f70d4ed chore: version bump
  • 1816551 chore(ci): adding poetry export plugin to support v2 (#5941)
  • 2a7a9aa chore(ci): adding poetry export plugin to support v2 (#5938)
  • d28d7f7 chore(ci): update poetry version to v2 (#5936)
  • 3d85ebb chore(ci): changelog rebuild (#5934)
  • baf3baf chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.289 to 0....
  • 50b0098 chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.176.0a0 to 2.177...
  • 98dbaa3 chore(deps-dev): bump boto3-stubs from 1.36.6 to 1.36.7 (#5932)
  • 93a0128 chore(deps-dev): bump aws-cdk-lib from 2.176.0 to 2.177.0 (#5931)
  • f68bb74 chore(deps-dev): bump aws-cdk from 2.176.0 to 2.177.0 (#5930)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [aws-lambda-powertools[parser]](https://github.com/aws-powertools/powertools-lambda-python) from 2.41.0 to 3.5.0.
- [Release notes](https://github.com/aws-powertools/powertools-lambda-python/releases)
- [Changelog](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CHANGELOG.md)
- [Upgrade guide](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/docs/upgrade.md)
- [Commits](aws-powertools/powertools-lambda-python@v2.41.0...v3.5.0)

---
updated-dependencies:
- dependency-name: aws-lambda-powertools[parser]
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Copy link
Contributor Author

dependabot bot commented on behalf of github Jan 28, 2025

The following labels could not be found: dependencies.

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.

0 participants