Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 17, 2025

Bumps aws-lambda-powertools from 2.35.1 to 3.6.0.

Release notes

Sourced from aws-lambda-powertools's releases.

v3.6.0

Summary

In this release, we are thrilled to announce new features and improvements:

  • Customizable masking capabilities with the erase method in Data Masking utility
  • Ability to disable metrics flush via environment variables
  • New Event Source Data Classes for API Gateway Authorizer Response WebSocket
  • New method to the Logger class to clear appended keys at any point during the execution of your Lambda invocation

Special thanks to @​philiptzou, for improving type annotations in our OpenAPI utility! ⭐

Custom masking support for Data Masking

Docs

You can now configure advanced masking options when using erase method in the Data Masking utility. This feature provides granular control to protect sensitive information while maintaining data readability and structure.

The new options to use with erase :

  • Dynamic Mask: Preserves text length and structure by replacing characters with *
  • Custom Mask: Apply simple pattern like "XX-XX"
  • Regex Mask: Advanced pattern-based masking for complex data formats
  • Field-specific Allows different masking rules for different data fields

data_masking_new

Disable flushing metrics using environment variables

Docs

You can now set the POWERTOOLS_METRICS_DISABLES environment variable to control the metrics output. This is useful when you want to silent metrics in a non-production environment. When POWERTOOLS_DEV is enabled, the metrics are also suppressed, but you can always override it by setting POWERTOOLS_METRICS_DISABLED=false when you want to continue emitting metrics while in dev mode.

image

Support for API Gateway Authorizer Response WebSocket

Docs

You can now use the new APIGatewayAuthorizerResponseWebSocket class to handle authorization policies for WebSocket APIs.

image

Clearing all appended keys with clear_state() method

Docs

... (truncated)

Changelog

Sourced from aws-lambda-powertools's changelog.

[v3.6.0] - 2025-02-11

Bug Fixes

  • docs: typo in a service name in Event Handler (#5944)
  • logger: child logger must respect log level (#5950)

Code Refactoring

  • metrics: Improve type annotations for metrics decorator (#6000)

Documentation

  • api: migrating the event handler utility to mkdocstrings (#6023)
  • api: migrating the metrics utility to mkdocstrings (#6022)
  • api: migrating the logger utility to mkdocstrings (#6021)
  • api: migrating the Middleware Factory utility to mkdocstrings (#6019)
  • api: migrating the tracer utility to mkdocstrings (#6017)
  • api: migrating the batch utility to mkdocstrings (#6016)
  • api: migrating the event source data classes utility to mkdocstrings (#6015)
  • api: migrating the data masking utility to mkdocstrings (#6013)
  • api: migrating the AppConfig utility to mkdocstrings (#6008)
  • api: migrating the idempotency utility to mkdocstrings (#6007)
  • api: migrating the jmespath utility to mkdocstrings (#6006)
  • api: migrating the parameters utility to mkdocstrings (#6005)
  • api: migrating the parser utility to mkdocstrings (#6004)
  • api: migrating the streaming utility to mkdocstrings (#6003)
  • api: migrating the typing utility to mkdocstrings (#5996)
  • api: migrating the validation utility to mkdocstrings (#5972)
  • layer: update layer version number - v3.5.0 (#5952)

Features

  • data-masking: add custom mask functionalities (#5837)
  • event_source: add class APIGatewayAuthorizerResponseWebSocket (#6058)
  • logger: add clear_state method (#5956)
  • metrics: disable metrics flush via environment variables (#6046)
  • openapi: enhance support for tuple return type validation (#5997)

Maintenance

  • version bump
  • ci: new pre-release 3.5.1a9 (#6069)
  • ci: new pre-release 3.5.1a0 (#5945)
  • ci: new pre-release 3.5.1a1 (#5954)
  • ci: new pre-release 3.5.1a8 (#6061)
  • ci: install & configure mkdocstrings plugin (#5959)
  • ci: new pre-release 3.5.1a2 (#5970)
  • ci: new pre-release 3.5.1a3 (#5998)
  • ci: new pre-release 3.5.1a7 (#6044)
  • ci: new pre-release 3.5.1a4 (#6018)

... (truncated)

Upgrade guide

Sourced from aws-lambda-powertools'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
  • c5ccfc9 chore: version bump
  • 4e3af55 chore(ci): changelog rebuild (#6070)
  • 6ff9f11 feat(data-masking): add custom mask functionalities (#5837)
  • 8ff6cac chore(ci): new pre-release 3.5.1a9 (#6069)
  • 1fa4700 feat(metrics): disable metrics flush via environment variables (#6046)
  • 1ca05a2 chore(deps-dev): bump ruff from 0.9.5 to 0.9.6 (#6066)
  • aade153 chore(deps-dev): bump coverage from 7.6.10 to 7.6.11 (#6067)
  • e722bdb chore(deps-dev): bump mkdocs-material from 9.6.2 to 9.6.3 (#6065)
  • 416e34b chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0...
  • a4ec359 feat(event_source): add class APIGatewayAuthorizerResponseWebSocket (#6058)
  • 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](https://github.com/aws-powertools/powertools-lambda-python) from 2.35.1 to 3.6.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.35.1...v3.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Feb 17, 2025
@sonarqubecloud
Copy link

@github-actions
Copy link

💥 Something went wrong while building the pull request environment.
Check Output Logs

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Mar 3, 2025

Superseded by #853.

@dependabot dependabot bot closed this Mar 3, 2025
@dependabot dependabot bot deleted the dependabot/pip/aws-lambda-powertools-3.6.0 branch March 3, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants