Skip to content

Commit 3ac3a54

Browse files
committed
chore: apply latest black formatting rules
1 parent fb7ac18 commit 3ac3a54

35 files changed

+75
-115
lines changed
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

+2-4
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,15 @@ def get_header_value(
186186
name: str,
187187
default_value: str,
188188
case_sensitive: Optional[bool] = False,
189-
) -> str:
190-
...
189+
) -> str: ...
191190

192191
@overload
193192
def get_header_value(
194193
self,
195194
name: str,
196195
default_value: Optional[str] = None,
197196
case_sensitive: Optional[bool] = False,
198-
) -> Optional[str]:
199-
...
197+
) -> Optional[str]: ...
200198

201199
def get_header_value(
202200
self,

aws_lambda_powertools/utilities/data_classes/vpc_lattice.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,15 @@ def get_header_value(
7373
name: str,
7474
default_value: str,
7575
case_sensitive: Optional[bool] = False,
76-
) -> str:
77-
...
76+
) -> str: ...
7877

7978
@overload
8079
def get_header_value(
8180
self,
8281
name: str,
8382
default_value: Optional[str] = None,
8483
case_sensitive: Optional[bool] = False,
85-
) -> Optional[str]:
86-
...
84+
) -> Optional[str]: ...
8785

8886
def get_header_value(
8987
self,

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/feature_flags/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Advanced feature flags utility"""
2+
23
from .appconfig import AppConfigStore
34
from .base import StoreProvider
45
from .exceptions import ConfigurationStoreError

aws_lambda_powertools/utilities/feature_flags/comparators.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
from dateutil.tz import gettz
55

6-
from .schema import HOUR_MIN_SEPARATOR, ModuloRangeValues, TimeValues
76
from .exceptions import SchemaValidationError
7+
from .schema import HOUR_MIN_SEPARATOR, ModuloRangeValues, TimeValues
88

99

1010
def _get_now_from_timezone(timezone: Optional[tzinfo]) -> datetime:
@@ -88,13 +88,13 @@ def compare_modulo_range(context_value: int, condition_value: Dict) -> bool:
8888
def compare_any_in_list(key_list, value_list):
8989
if not (isinstance(key_list, list) and isinstance(value_list, list)):
9090
raise SchemaValidationError()
91-
91+
9292
results = False
9393
for key in key_list:
9494
if key in value_list:
9595
results = True
9696
break
97-
97+
9898
return results
9999

100100

@@ -122,4 +122,3 @@ def compare_none_in_list(key_list, value_list):
122122
break
123123

124124
return results
125-

aws_lambda_powertools/utilities/feature_flags/feature_flags.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
from . import schema
77
from .base import StoreProvider
88
from .comparators import (
9+
compare_all_in_list,
10+
compare_any_in_list,
911
compare_datetime_range,
1012
compare_days_of_week,
1113
compare_modulo_range,
14+
compare_none_in_list,
1215
compare_time_range,
13-
compare_all_in_list,
14-
compare_any_in_list,
15-
compare_none_in_list
1616
)
1717
from .exceptions import ConfigurationStoreError
1818

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/persistence/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Persistence layers supporting idempotency
33
"""
4+
45
import datetime
56
import hashlib
67
import json

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/base.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Base for Parameter providers
33
"""
4+
45
from __future__ import annotations
56

67
import base64
@@ -372,8 +373,7 @@ def transform_value(
372373
transform: TransformOptions,
373374
raise_on_transform_error: bool = False,
374375
key: str = "",
375-
) -> Dict[str, Any]:
376-
...
376+
) -> Dict[str, Any]: ...
377377

378378

379379
@overload
@@ -382,8 +382,7 @@ def transform_value(
382382
transform: TransformOptions,
383383
raise_on_transform_error: bool = False,
384384
key: str = "",
385-
) -> Optional[Union[str, bytes, Dict[str, Any]]]:
386-
...
385+
) -> Optional[Union[str, bytes, Dict[str, Any]]]: ...
387386

388387

389388
def transform_value(

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/secrets.py

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

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

0 commit comments

Comments
 (0)