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

chore(deps): bump aws-lambda-powertools from 2.27.0 to 2.28.0 in /lambda/src #632

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 27, 2023

Bumps aws-lambda-powertools from 2.27.0 to 2.28.0.

Release notes

Sourced from aws-lambda-powertools's releases.

v2.28.0

Summary

This release adds support for Data Validation and automatic OpenAPI generation in Event Handler.

Even better, it works with your existing resolver (API Gateway REST/HTTP, ALB, Lambda Function URL, VPC Lattice)!

Did you read that correctly? Yes, you did! Look at this:

image (9)

Data validation

Docs: Data validation

By adding enable_validation=True to your resolver constructor, you’ll change the way the resolver works. We will:

  1. inspect your route handlers to gather input and output types (including Pydantic models and dataclasses)
  2. validate and coerce the input data for you automatically before invoking your route handlers
  3. validate and coerce the output data for you automatically after invoking your route handlers
  4. enable a cool feature (see the next section!)

This moves data validation responsibilities to Event Handler resolvers, reducing a ton of boilerplate code. You can now focus on just writing your business logic, and leave the validation to us!

from typing import List, Optional
import requests
from pydantic import BaseModel, Field
from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.logging import correlation_paths
from aws_lambda_powertools.utilities.typing import LambdaContext
tracer = Tracer()
logger = Logger()
app = APIGatewayRestResolver(enable_validation=True)
class Todo(BaseModel):
userId: int
id_: Optional[int] = Field(alias="id", default=None)
title: str
completed: bool
@​app.post("/todos")
def create_todo(todo: Todo) -> str:
response = requests.post("https://jsonplaceholder.typicode.com/todos", json=todo.dict(by_alias=True))
</tr></table>

... (truncated)

Changelog

Sourced from aws-lambda-powertools's changelog.

[v2.28.0] - 2023-11-23

Documentation

  • event_handlers: new data validation and OpenAPI feature (#3386)

Maintenance

  • version bump

[v2.27.1] - 2023-11-21

Bug Fixes

  • logger: allow custom JMESPath functions to extract correlation ID (#3382)

Documentation

  • event_handlers: note that CORS and / binary mime type don't work in API Gateway (#3383)
  • logger: improve ALC messaging in the PT context (#3359)
  • logger: Fix ALC link (#3352)

Features

  • logger: implement addFilter/removeFilter to address static typing errors (#3380)

Maintenance

  • version bump
  • ci: lint and type checking removal in Pydantic v2 quality check (#3360)
  • deps: bump actions/github-script from 7.0.0 to 7.0.1 (#3377)
  • deps: bump squidfunk/mkdocs-material from 2c57e4d to fc42bac in /docs (#3375)
  • deps: bump the layer-balancer group in /layer/scripts/layer-balancer with 2 updates (#3353)
  • deps: bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3374)
  • deps: bump squidfunk/mkdocs-material from f486dc9 to 2c57e4d in /docs (#3366)
  • deps-dev: bump cfn-lint from 0.83.2 to 0.83.3 (#3363)
  • deps-dev: bump the boto-typing group with 11 updates (#3362)
  • deps-dev: bump aws-cdk-lib from 2.108.1 to 2.110.0 (#3365)
  • deps-dev: bump aws-cdk from 2.108.1 to 2.109.0 (#3354)
  • deps-dev: bump aws-cdk from 2.109.0 to 2.110.0 (#3361)
  • deps-dev: bump the boto-typing group with 2 updates (#3376)
  • deps-dev: bump ruff from 0.1.5 to 0.1.6 (#3364)

Commits
  • 547372e chore: version bump
  • 765781c docs(event_handlers): new data validation and OpenAPI feature (#3386)
  • 89a92b7 chore(deps-dev): bump the boto-typing group with 1 update (#3400)
  • 334a30b chore(deps-dev): bump aws-cdk-lib from 2.110.0 to 2.110.1 (#3402)
  • 716ff9a fix(event_handler): hide error details by default (#3406)
  • 365c2dc chore(deps): bump datadog-lambda from 4.82.0 to 5.83.0 (#3401)
  • 5a78fd5 chore(deps-dev): bump aws-cdk from 2.110.0 to 2.110.1 (#3403)
  • 148ae87 chore(ci): changelog rebuild (#3404)
  • 9f59374 fix(event_handler): fix format for OpenAPI path templating (#3399)
  • 0cc687a fix(event_handler): lazy load Pydantic to improve cold start (#3397)
  • 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.27.0 to 2.28.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)
- [Commits](aws-powertools/powertools-lambda-python@v2.27.0...v2.28.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Nov 27, 2023
@mergify mergify bot merged commit e77b5c6 into master Nov 27, 2023
6 checks passed
@mergify mergify bot deleted the dependabot/pip/lambda/src/aws-lambda-powertools-2.28.0 branch November 27, 2023 06:43
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