Skip to content

Commit 5098ed9

Browse files
committed
Merge branch 'develop' into setparams
* develop: chore: cleanup, add test for single and nested fix(parameters): make cache aware of single vs multiple calls chore(deps-dev): bump black from 24.1.1 to 24.2.0 (aws-powertools#3760) chore(ci): changelog rebuild (aws-powertools#3858) chore(deps): bump codecov/codecov-action from 4.0.2 to 4.1.0 (aws-powertools#3856) chore(deps): bump squidfunk/mkdocs-material from `43b898a` to `49d1bfd` in /docs (aws-powertools#3857) Signed-off-by: heitorlessa <[email protected]>
2 parents 7783aad + 8704337 commit 5098ed9

34 files changed

+102
-108
lines changed

.github/workflows/quality_check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Complexity baseline
7272
run: make complexity-baseline
7373
- name: Upload coverage to Codecov
74-
uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # 4.0.2
74+
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # 4.1.0
7575
with:
7676
file: ./coverage.xml
7777
env_vars: PYTHON

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,37 @@
44
<a name="unreleased"></a>
55
# Unreleased
66

7+
## Maintenance
8+
9+
710

811
<a name="v2.34.2"></a>
912
## [v2.34.2] - 2024-02-26
13+
## Bug Fixes
14+
15+
* **typing:** ensure return type is a str when default_value is set ([#3840](https://github.com/aws-powertools/powertools-lambda-python/issues/3840))
16+
17+
## Documentation
18+
19+
* **install:** make minimum install the default option then extra ([#3834](https://github.com/aws-powertools/powertools-lambda-python/issues/3834))
20+
21+
## Features
22+
23+
* **event-source:** add function to get multi-value query string params by name ([#3846](https://github.com/aws-powertools/powertools-lambda-python/issues/3846))
24+
1025
## Maintenance
1126

1227
* version bump
1328
* **ci:** remove aws-encryption-sdk from Lambda layer due to cffi being tied to python version ([#3853](https://github.com/aws-powertools/powertools-lambda-python/issues/3853))
29+
* **deps:** bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates ([#3844](https://github.com/aws-powertools/powertools-lambda-python/issues/3844))
30+
* **deps:** bump cryptography from 42.0.2 to 42.0.4 ([#3827](https://github.com/aws-powertools/powertools-lambda-python/issues/3827))
31+
* **deps:** bump codecov/codecov-action from 4.0.1 to 4.0.2 ([#3842](https://github.com/aws-powertools/powertools-lambda-python/issues/3842))
32+
* **deps:** bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates ([#3835](https://github.com/aws-powertools/powertools-lambda-python/issues/3835))
33+
* **deps-dev:** bump httpx from 0.26.0 to 0.27.0 ([#3828](https://github.com/aws-powertools/powertools-lambda-python/issues/3828))
34+
* **deps-dev:** bump aws-cdk from 2.128.0 to 2.129.0 ([#3831](https://github.com/aws-powertools/powertools-lambda-python/issues/3831))
35+
* **deps-dev:** bump the boto-typing group with 1 update ([#3836](https://github.com/aws-powertools/powertools-lambda-python/issues/3836))
36+
* **deps-dev:** bump aws-cdk from 2.129.0 to 2.130.0 ([#3843](https://github.com/aws-powertools/powertools-lambda-python/issues/3843))
37+
* **deps-dev:** bump aws-cdk-lib from 2.128.0 to 2.130.0 ([#3838](https://github.com/aws-powertools/powertools-lambda-python/issues/3838))
1438

1539

1640
<a name="v2.34.1"></a>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Logging utility
22
"""
3+
34
from .logger import Logger
45

56
__all__ = ["Logger"]

aws_lambda_powertools/logging/logger.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ def inject_lambda_context(
345345
log_event: Optional[bool] = None,
346346
correlation_id_path: Optional[str] = None,
347347
clear_state: Optional[bool] = False,
348-
) -> AnyCallableT:
349-
...
348+
) -> AnyCallableT: ...
350349

351350
@overload
352351
def inject_lambda_context(
@@ -355,8 +354,7 @@ def inject_lambda_context(
355354
log_event: Optional[bool] = None,
356355
correlation_id_path: Optional[str] = None,
357356
clear_state: Optional[bool] = False,
358-
) -> Callable[[AnyCallableT], AnyCallableT]:
359-
...
357+
) -> Callable[[AnyCallableT], AnyCallableT]: ...
360358

361359
def inject_lambda_context(
362360
self,

aws_lambda_powertools/metrics/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""CloudWatch Embedded Metric Format utility
22
"""
3+
34
from aws_lambda_powertools.metrics.base import MetricResolution, MetricUnit, single_metric
45
from aws_lambda_powertools.metrics.exceptions import (
56
MetricResolutionError,
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Utilities to enhance middlewares """
2+
23
from .factory import lambda_handler_decorator
34

45
__all__ = ["lambda_handler_decorator"]

aws_lambda_powertools/shared/functions.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,15 @@ def resolve_max_age(env: str, choice: Optional[int]) -> int:
5757

5858

5959
@overload
60-
def resolve_env_var_choice(env: Optional[str], choice: float) -> float:
61-
...
60+
def resolve_env_var_choice(env: Optional[str], choice: float) -> float: ...
6261

6362

6463
@overload
65-
def resolve_env_var_choice(env: Optional[str], choice: str) -> str:
66-
...
64+
def resolve_env_var_choice(env: Optional[str], choice: str) -> str: ...
6765

6866

6967
@overload
70-
def resolve_env_var_choice(env: Optional[str], choice: Optional[str]) -> str:
71-
...
68+
def resolve_env_var_choice(env: Optional[str], choice: Optional[str]) -> str: ...
7269

7370

7471
def resolve_env_var_choice(

aws_lambda_powertools/tracing/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tracing utility
22
"""
33

4-
54
from .extensions import aiohttp_trace_config
65
from .tracer import Tracer
76

aws_lambda_powertools/tracing/tracer.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -345,17 +345,15 @@ def decorate(event, context, **kwargs):
345345

346346
# see #465
347347
@overload
348-
def capture_method(self, method: "AnyCallableT") -> "AnyCallableT":
349-
... # pragma: no cover
348+
def capture_method(self, method: "AnyCallableT") -> "AnyCallableT": ... # pragma: no cover
350349

351350
@overload
352351
def capture_method(
353352
self,
354353
method: None = None,
355354
capture_response: Optional[bool] = None,
356355
capture_error: Optional[bool] = None,
357-
) -> Callable[["AnyCallableT"], "AnyCallableT"]:
358-
... # pragma: no cover
356+
) -> Callable[["AnyCallableT"], "AnyCallableT"]: ... # pragma: no cover
359357

360358
def capture_method(
361359
self,

aws_lambda_powertools/utilities/batch/base.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,15 @@ def _collect_dynamodb_failures(self):
339339
return failures
340340

341341
@overload
342-
def _to_batch_type(self, record: dict, event_type: EventType, model: "BatchTypeModels") -> "BatchTypeModels":
343-
... # pragma: no cover
342+
def _to_batch_type(
343+
self,
344+
record: dict,
345+
event_type: EventType,
346+
model: "BatchTypeModels",
347+
) -> "BatchTypeModels": ... # pragma: no cover
344348

345349
@overload
346-
def _to_batch_type(self, record: dict, event_type: EventType) -> EventSourceDataClassTypes:
347-
... # pragma: no cover
350+
def _to_batch_type(self, record: dict, event_type: EventType) -> EventSourceDataClassTypes: ... # pragma: no cover
348351

349352
def _to_batch_type(self, record: dict, event_type: EventType, model: Optional["BatchTypeModels"] = None):
350353
if model is not None:

aws_lambda_powertools/utilities/batch/exceptions.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Batch processing exceptions
33
"""
4+
45
from __future__ import annotations
56

67
import traceback

aws_lambda_powertools/utilities/data_classes/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def get_multi_value_query_string_values(
193193
self,
194194
name: str,
195195
default_values: Optional[List[str]] = None,
196-
) ->List[str]:
196+
) -> List[str]:
197197
"""Get multi-value query string parameter values by name
198198
199199
Parameters

aws_lambda_powertools/utilities/data_masking/base.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,16 @@ def decrypt(
8585
)
8686

8787
@overload
88-
def erase(self, data, fields: None) -> str:
89-
...
88+
def erase(self, data, fields: None) -> str: ...
9089

9190
@overload
92-
def erase(self, data: list, fields: list[str]) -> list[str]:
93-
...
91+
def erase(self, data: list, fields: list[str]) -> list[str]: ...
9492

9593
@overload
96-
def erase(self, data: tuple, fields: list[str]) -> tuple[str]:
97-
...
94+
def erase(self, data: tuple, fields: list[str]) -> tuple[str]: ...
9895

9996
@overload
100-
def erase(self, data: dict, fields: list[str]) -> dict:
101-
...
97+
def erase(self, data: dict, fields: list[str]) -> dict: ...
10298

10399
def erase(self, data: Sequence | Mapping, fields: list[str] | None = None) -> str | list[str] | tuple[str] | dict:
104100
return self._apply_action(data=data, fields=fields, action=self.provider.erase)

aws_lambda_powertools/utilities/data_masking/provider/kms/aws_encryption_sdk.py

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def decrypt(self, data: str, provider_options: dict | None = None, **encryption_
105105

106106

107107
class KMSKeyProvider:
108-
109108
"""
110109
The KMSKeyProvider is responsible for assembling an AWS Key Management Service (KMS)
111110
client, a caching mechanism, and a keyring for secure key management and data encryption.

aws_lambda_powertools/utilities/idempotency/exceptions.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Idempotency errors
33
"""
44

5-
65
from typing import Optional, Union
76

87
from aws_lambda_powertools.utilities.idempotency.persistence.datarecord import DataRecord

aws_lambda_powertools/utilities/idempotency/idempotency.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Primary interface for idempotent Lambda functions utility
33
"""
4+
45
import functools
56
import logging
67
import os

aws_lambda_powertools/utilities/idempotency/serialization/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Serialization for supporting idempotency
33
"""
4+
45
from abc import ABC, abstractmethod
56
from typing import Any, Dict
67

aws_lambda_powertools/utilities/parameters/appconfig.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
AWS App Config configuration retrieval and caching utility
33
"""
44

5-
65
import os
76
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
87

aws_lambda_powertools/utilities/parameters/dynamodb.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Amazon DynamoDB parameter retrieval and caching utility
33
"""
44

5-
65
from typing import TYPE_CHECKING, Dict, Optional
76

87
import boto3

aws_lambda_powertools/utilities/parameters/exceptions.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
class GetParameterError(Exception):
77
"""When a provider raises an exception on parameter retrieval"""
88

9+
910
class TransformParameterError(Exception):
1011
"""When a provider fails to transform a parameter value"""
1112

13+
1214
class SetParameterError(Exception):
1315
"""When a provider raises an exception on setting a parameter"""

aws_lambda_powertools/utilities/parameters/secrets.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
AWS Secrets Manager parameter retrieval and caching utility
33
"""
4+
45
from __future__ import annotations
56

67
import json

aws_lambda_powertools/utilities/parameters/ssm.py

+13-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
AWS SSM Parameter retrieval and caching utility
33
"""
4+
45
from __future__ import annotations
56

67
import os
@@ -556,8 +557,7 @@ def get_parameter(
556557
force_fetch: bool = False,
557558
max_age: Optional[int] = None,
558559
**sdk_options,
559-
) -> str:
560-
...
560+
) -> str: ...
561561

562562

563563
@overload
@@ -568,8 +568,7 @@ def get_parameter(
568568
force_fetch: bool = False,
569569
max_age: Optional[int] = None,
570570
**sdk_options,
571-
) -> dict:
572-
...
571+
) -> dict: ...
573572

574573

575574
@overload
@@ -580,8 +579,7 @@ def get_parameter(
580579
force_fetch: bool = False,
581580
max_age: Optional[int] = None,
582581
**sdk_options,
583-
) -> Union[str, dict, bytes]:
584-
...
582+
) -> Union[str, dict, bytes]: ...
585583

586584

587585
@overload
@@ -592,8 +590,7 @@ def get_parameter(
592590
force_fetch: bool = False,
593591
max_age: Optional[int] = None,
594592
**sdk_options,
595-
) -> bytes:
596-
...
593+
) -> bytes: ...
597594

598595

599596
def get_parameter(
@@ -686,8 +683,7 @@ def get_parameters(
686683
max_age: Optional[int] = None,
687684
raise_on_transform_error: bool = False,
688685
**sdk_options,
689-
) -> Dict[str, str]:
690-
...
686+
) -> Dict[str, str]: ...
691687

692688

693689
@overload
@@ -700,8 +696,7 @@ def get_parameters(
700696
max_age: Optional[int] = None,
701697
raise_on_transform_error: bool = False,
702698
**sdk_options,
703-
) -> Dict[str, dict]:
704-
...
699+
) -> Dict[str, dict]: ...
705700

706701

707702
@overload
@@ -714,8 +709,7 @@ def get_parameters(
714709
max_age: Optional[int] = None,
715710
raise_on_transform_error: bool = False,
716711
**sdk_options,
717-
) -> Dict[str, bytes]:
718-
...
712+
) -> Dict[str, bytes]: ...
719713

720714

721715
@overload
@@ -728,8 +722,7 @@ def get_parameters(
728722
max_age: Optional[int] = None,
729723
raise_on_transform_error: bool = False,
730724
**sdk_options,
731-
) -> Union[Dict[str, bytes], Dict[str, dict], Dict[str, str]]:
732-
...
725+
) -> Union[Dict[str, bytes], Dict[str, dict], Dict[str, str]]: ...
733726

734727

735728
def get_parameters(
@@ -903,8 +896,7 @@ def get_parameters_by_name(
903896
decrypt: Optional[bool] = None,
904897
max_age: Optional[int] = None,
905898
raise_on_error: bool = True,
906-
) -> Dict[str, str]:
907-
...
899+
) -> Dict[str, str]: ...
908900

909901

910902
@overload
@@ -914,8 +906,7 @@ def get_parameters_by_name(
914906
decrypt: Optional[bool] = None,
915907
max_age: Optional[int] = None,
916908
raise_on_error: bool = True,
917-
) -> Dict[str, bytes]:
918-
...
909+
) -> Dict[str, bytes]: ...
919910

920911

921912
@overload
@@ -925,8 +916,7 @@ def get_parameters_by_name(
925916
decrypt: Optional[bool] = None,
926917
max_age: Optional[int] = None,
927918
raise_on_error: bool = True,
928-
) -> Dict[str, Dict[str, Any]]:
929-
...
919+
) -> Dict[str, Dict[str, Any]]: ...
930920

931921

932922
@overload
@@ -936,8 +926,7 @@ def get_parameters_by_name(
936926
decrypt: Optional[bool] = None,
937927
max_age: Optional[int] = None,
938928
raise_on_error: bool = True,
939-
) -> Union[Dict[str, str], Dict[str, dict]]:
940-
...
929+
) -> Union[Dict[str, str], Dict[str, dict]]: ...
941930

942931

943932
def get_parameters_by_name(

0 commit comments

Comments
 (0)