Skip to content

chore(v3): merging develop into v3 - 15/05/2024 #4335

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

Merged
merged 77 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
7268299
chore(deps): bump squidfunk/mkdocs-material from `e309089` to `98c980…
dependabot[bot] Apr 30, 2024
21e71c5
chore(deps-dev): bump pytest from 8.1.1 to 8.2.0 (#4237)
dependabot[bot] Apr 30, 2024
5512651
chore(deps): bump actions/dependency-review-action from 4.2.5 to 4.3.…
dependabot[bot] Apr 30, 2024
517f4e8
chore(deps-dev): bump mkdocs-material from 9.5.19 to 9.5.20 (#4242)
dependabot[bot] Apr 30, 2024
dccb728
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] Apr 30, 2024
ba1bedb
chore(deps-dev): bump hvac from 2.1.0 to 2.2.0 (#4238)
dependabot[bot] Apr 30, 2024
90b125f
chore(deps-dev): bump filelock from 3.13.4 to 3.14.0 (#4241)
dependabot[bot] Apr 30, 2024
06fbf2c
chore(deps): bump actions/dependency-review-action from 4.3.1 to 4.3.…
dependabot[bot] May 2, 2024
c3220aa
chore(deps-dev): bump aws-cdk from 2.139.0 to 2.139.1 (#4245)
dependabot[bot] May 2, 2024
a6f381b
chore(deps): bump codecov/codecov-action from 4.3.0 to 4.3.1 (#4252)
dependabot[bot] May 2, 2024
47df6c8
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 2, 2024
33ec120
chore(deps): bump datadog-lambda from 5.93.0 to 5.94.0 (#4253)
dependabot[bot] May 2, 2024
5b09019
chore(deps-dev): bump pytest-xdist from 3.5.0 to 3.6.1 (#4247)
dependabot[bot] May 2, 2024
bcb1386
chore(deps-dev): bump cfn-lint from 0.86.4 to 0.87.0 (#4249)
dependabot[bot] May 2, 2024
dda10b4
chore(deps-dev): bump aws-cdk-lib from 2.139.0 to 2.139.1 (#4248)
dependabot[bot] May 2, 2024
7830401
chore(ci): changelog rebuild (#4254)
github-actions[bot] May 2, 2024
583bacc
fix(ci): apply lessons learned to monthly roadmap reminder cross-repo…
heitorlessa May 2, 2024
3d2ec76
chore(deps-dev): bump mypy-boto3-dynamodb from 1.34.91 to 1.34.97 in …
dependabot[bot] May 3, 2024
b4f25df
chore(deps-dev): bump aws-cdk from 2.139.1 to 2.140.0 (#4256)
dependabot[bot] May 3, 2024
0042174
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 3, 2024
083f73f
chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.139.0a0 …
dependabot[bot] May 3, 2024
2977359
chore(deps): bump slsa-framework/slsa-github-generator from 1.10.0 to…
dependabot[bot] May 3, 2024
ea00ca0
chore(deps-dev): bump aws-cdk-lib from 2.139.1 to 2.140.0 (#4259)
dependabot[bot] May 3, 2024
f005ae2
chore(deps-dev): bump mike from 1.1.2 to 2.1.0 (#4258)
dependabot[bot] May 3, 2024
24a252f
chore(ci): changelog rebuild (#4262)
github-actions[bot] May 3, 2024
f0385b9
chore(deps-dev): bump mike from 2.1.0 to 2.1.1 (#4268)
dependabot[bot] May 6, 2024
fdde50b
chore(deps-dev): bump mkdocs-material from 9.5.20 to 9.5.21 (#4271)
dependabot[bot] May 6, 2024
72a11b2
chore(deps-dev): bump cfn-lint from 0.87.0 to 0.87.1 (#4272)
dependabot[bot] May 6, 2024
4eb881a
chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.139.1a0 …
dependabot[bot] May 6, 2024
285714b
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 6, 2024
704f029
chore(ci): changelog rebuild (#4278)
github-actions[bot] May 6, 2024
f1cbcb3
chore(deps): bump squidfunk/mkdocs-material from `98c9809` to `11d7ec…
dependabot[bot] May 6, 2024
0412f66
feat(event_handler): add decorator for HTTP HEAD verb (#4275)
nlykkei May 6, 2024
2340ce5
chore(ci): changelog rebuild (#4289)
github-actions[bot] May 7, 2024
6cb7a88
chore(deps-dev): bump coverage from 7.5.0 to 7.5.1 (#4288)
dependabot[bot] May 7, 2024
6cf0b71
chore(deps-dev): bump sentry-sdk from 2.0.1 to 2.1.1 (#4287)
dependabot[bot] May 7, 2024
d23b95f
chore(deps-dev): bump ruff from 0.4.2 to 0.4.3 (#4286)
dependabot[bot] May 7, 2024
abd4418
chore(deps-dev): bump jinja2 from 3.1.3 to 3.1.4 (#4283)
dependabot[bot] May 7, 2024
8d3aff2
chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#4284)
dependabot[bot] May 7, 2024
a1a9883
chore(deps): bump actions/checkout from 4.1.4 to 4.1.5 (#4282)
dependabot[bot] May 7, 2024
d3d86bc
chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions …
dependabot[bot] May 7, 2024
196b671
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 7, 2024
2cc71d1
fix(typing): resolved_headers_field is not Optional (#4148)
tonnico May 7, 2024
3a6dbe0
fix(parser): make etag optional field on S3 notification events (#4173)
benjamingorman May 7, 2024
7ab6a80
docs(homepage): add link to new and official workshop (#4292)
dreamorosi May 7, 2024
e285d5b
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 8, 2024
e474219
chore(ci): changelog rebuild (#4294)
github-actions[bot] May 8, 2024
9251384
chore(governance): add FastAPI third party license attribution (#4297)
leandrodamascena May 8, 2024
c69903c
chore(deps): bump the layer-balancer group in /layer/scripts/layer-ba…
dependabot[bot] May 9, 2024
efc02aa
chore(ci): changelog rebuild (#4304)
github-actions[bot] May 9, 2024
8d05b17
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 9, 2024
78e5c27
fix(event-sources): sane defaults for authorizer v1 and v2 (#4298)
heitorlessa May 9, 2024
3f309bd
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 10, 2024
476d8e0
chore(deps-dev): bump aws-cdk from 2.140.0 to 2.141.0 (#4306)
dependabot[bot] May 10, 2024
2a745d7
chore(deps-dev): bump aws-cdk-lib from 2.140.0 to 2.141.0 (#4308)
dependabot[bot] May 10, 2024
5dc44ad
chore(deps-dev): bump ruff from 0.4.3 to 0.4.4 (#4309)
dependabot[bot] May 10, 2024
17b62b8
chore(ci): changelog rebuild (#4311)
github-actions[bot] May 10, 2024
8aa64b6
chore(deps): bump ossf/scorecard-action from 2.3.1 to 2.3.3 (#4315)
dependabot[bot] May 12, 2024
0815fd5
chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.140.0a0 …
dependabot[bot] May 12, 2024
3b323c1
chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.27.12 to…
dependabot[bot] May 12, 2024
10553d0
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 12, 2024
bd9488a
chore(ci): changelog rebuild (#4321)
github-actions[bot] May 12, 2024
5b15744
chore(deps-dev): bump cfn-lint from 0.87.1 to 0.87.2 (#4317)
dependabot[bot] May 12, 2024
97904cf
feat(event_handler): add support for persisting authorization session…
nlykkei May 12, 2024
f526b84
chore(ci): changelog rebuild (#4322)
github-actions[bot] May 13, 2024
69d25ef
fix(logger): correctly pick powertools or custom handler in custom en…
heitorlessa May 13, 2024
a9a8f70
chore(deps): bump squidfunk/mkdocs-material from `11d7ec0` to `8ef47d…
dependabot[bot] May 14, 2024
5d85495
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 14, 2024
0daec3a
chore(deps-dev): bump mkdocs-material from 9.5.21 to 9.5.22 (#4324)
dependabot[bot] May 14, 2024
87d580a
chore(ci): changelog rebuild (#4326)
github-actions[bot] May 14, 2024
6e0d45c
chore(deps-dev): bump mypy-boto3-s3 from 1.34.91 to 1.34.105 in the b…
dependabot[bot] May 15, 2024
b6256fb
chore(deps): bump codecov/codecov-action from 4.3.1 to 4.4.0 (#4328)
dependabot[bot] May 15, 2024
5963099
chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.1…
dependabot[bot] May 15, 2024
faca79b
chore(ci): changelog rebuild (#4331)
github-actions[bot] May 15, 2024
1aae9f8
refactor(data-masking): remove Non-GA comments (#4334)
leandrodamascena May 15, 2024
405137f
Merging from develop
leandrodamascena May 15, 2024
acb8dd7
Merging from develop
leandrodamascena May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(typing): resolved_headers_field is not Optional (#4148)
Co-authored-by: Heitor Lessa <lessa@amazon.com>
  • Loading branch information
tonnico and heitorlessa authored May 7, 2024
commit 2cc71d17b569c878f75c2b9d8133cebc4bcdab8c
6 changes: 3 additions & 3 deletions aws_lambda_powertools/event_handler/api_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -1646,13 +1646,13 @@ def _determine_openapi_version(openapi_version):
from aws_lambda_powertools.event_handler.openapi.pydantic_loader import PYDANTIC_V2

# Pydantic V2 has no support for OpenAPI schema 3.0
if PYDANTIC_V2 and not openapi_version.startswith("3.1"):
if PYDANTIC_V2 and not openapi_version.startswith("3.1"): # pragma: no cover
warnings.warn(
"You are using Pydantic v2, which is incompatible with OpenAPI schema 3.0. Forcing OpenAPI 3.1",
stacklevel=2,
)
openapi_version = "3.1.0"
elif not PYDANTIC_V2 and not openapi_version.startswith("3.0"):
elif not PYDANTIC_V2 and not openapi_version.startswith("3.0"): # pragma: no cover
warnings.warn(
"You are using Pydantic v1, which is incompatible with OpenAPI schema 3.1. Forcing OpenAPI 3.0",
stacklevel=2,
Expand Down Expand Up @@ -2192,7 +2192,7 @@ def not_found(self, func: Optional[Callable] = None):

def exception_handler(self, exc_class: Union[Type[Exception], List[Type[Exception]]]):
def register_exception_handler(func: Callable):
if isinstance(exc_class, list):
if isinstance(exc_class, list): # pragma: no cover
for exp in exc_class:
self._exception_handlers[exp] = func
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def _normalize_multi_query_string_with_param(
return resolved_query_string


def _normalize_multi_header_values_with_param(headers: Optional[Dict[str, str]], params: Sequence[ModelField]):
def _normalize_multi_header_values_with_param(headers: Dict[str, Any], params: Sequence[ModelField]):
"""
Extract and normalize resolved_headers_field

Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/event_handler/openapi/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

RequestErrorModel: Type[BaseModel] = create_model("Request")

if PYDANTIC_V2:
if PYDANTIC_V2: # pragma: no cover # false positive; dropping in v3
from pydantic import TypeAdapter, ValidationError
from pydantic._internal._typing_extra import eval_type_lenient
from pydantic.fields import FieldInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
except ImportError:
PYDANTIC_V2 = False
PYDANTIC_V2 = False # pragma: no cover # false positive; dropping in v3
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/batch/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# For IntelliSense and Mypy to work, we need to account for possible SQS subclasses
# We need them as subclasses as we must access their message ID or sequence number metadata via dot notation
if has_pydantic:
if has_pydantic: # pragma: no cover
from aws_lambda_powertools.utilities.parser.models import DynamoDBStreamRecordModel, SqsRecordModel
from aws_lambda_powertools.utilities.parser.models import (
KinesisDataStreamRecord as KinesisDataStreamRecordModel,
Expand All @@ -17,7 +17,7 @@
Union[Type[SqsRecordModel], Type[DynamoDBStreamRecordModel], Type[KinesisDataStreamRecordModel]]
]
BatchSqsTypeModel = Optional[Type[SqsRecordModel]]
else:
else: # pragma: no cover
BatchTypeModels = "BatchTypeModels" # type: ignore
BatchSqsTypeModel = "BatchSqsTypeModel" # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/data_classes/alb_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def resolved_query_string_parameters(self) -> Dict[str, List[str]]:
return super().resolved_query_string_parameters

@property
def resolved_headers_field(self) -> Optional[Dict[str, Any]]:
def resolved_headers_field(self) -> Dict[str, Any]:
headers: Dict[str, Any] = {}

if self.multi_value_headers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def resolved_query_string_parameters(self) -> Dict[str, List[str]]:
return super().resolved_query_string_parameters

@property
def resolved_headers_field(self) -> Optional[Dict[str, Any]]:
def resolved_headers_field(self) -> Dict[str, Any]:
headers: Dict[str, Any] = {}

if self.multi_value_headers:
Expand Down Expand Up @@ -319,7 +319,7 @@ def header_serializer(self):
return HttpApiHeadersSerializer()

@property
def resolved_headers_field(self) -> Optional[Dict[str, Any]]:
def resolved_headers_field(self) -> Dict[str, Any]:
if self.headers is not None:
headers = {key.lower(): value.split(",") if "," in value else value for key, value in self.headers.items()}
return headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def query_string_parameters(self) -> Optional[Dict[str, str]]:
return {x["name"]: x["value"] for x in self["parameters"]} if self.get("parameters") else None

@property
def resolved_headers_field(self) -> Optional[Dict[str, Any]]:
def resolved_headers_field(self) -> Dict[str, Any]:
return {}

@cached_property
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/data_classes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def resolved_query_string_parameters(self) -> Dict[str, List[str]]:
return {}

@property
def resolved_headers_field(self) -> Optional[Dict[str, Any]]:
def resolved_headers_field(self) -> Dict[str, Any]:
"""
This property determines the appropriate header to be used
as a trusted source for validating OpenAPI.
Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/data_classes/vpc_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def query_string_parameters(self) -> Dict[str, str]:
return self["query_string_parameters"]

@property
def resolved_headers_field(self) -> Optional[Dict[str, Any]]:
def resolved_headers_field(self) -> Dict[str, Any]:
if self.headers is not None:
headers = {key.lower(): value.split(",") if "," in value else value for key, value in self.headers.items()}
return headers
Expand Down Expand Up @@ -272,7 +272,7 @@ def query_string_parameters(self) -> Optional[Dict[str, str]]:
return None

@property
def resolved_headers_field(self) -> Optional[Dict[str, str]]:
def resolved_headers_field(self) -> Dict[str, str]:
if self.headers is not None:
return {key.lower(): value for key, value in self.headers.items()}

Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/parser/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def disable_pydantic_v2_warning():

version = __version__.split(".")

if int(version[0]) == 2:
if int(version[0]) == 2: # pragma: no cover # dropping in v3
import warnings

from pydantic import PydanticDeprecatedSince20, PydanticDeprecationWarning

warnings.filterwarnings("ignore", category=PydanticDeprecationWarning)
warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20)

except ImportError:
except ImportError: # pragma: no cover # false positive; dropping in v3
pass
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ omit = [
"aws_lambda_powertools/exceptions/*",
"aws_lambda_powertools/utilities/parser/types.py",
"aws_lambda_powertools/utilities/jmespath_utils/envelopes.py",
"aws_lambda_powertools/metrics/metric.py" # barrel import (export-only)
]
branch = true

Expand Down