Skip to content

chore(deps-dev): bump black from 24.1.1 to 24.2.0 #3760

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 5 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions aws_lambda_powertools/logging/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Logging utility
"""

from .logger import Logger

__all__ = ["Logger"]
6 changes: 2 additions & 4 deletions aws_lambda_powertools/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ def inject_lambda_context(
log_event: Optional[bool] = None,
correlation_id_path: Optional[str] = None,
clear_state: Optional[bool] = False,
) -> AnyCallableT:
...
) -> AnyCallableT: ...

@overload
def inject_lambda_context(
Expand All @@ -355,8 +354,7 @@ def inject_lambda_context(
log_event: Optional[bool] = None,
correlation_id_path: Optional[str] = None,
clear_state: Optional[bool] = False,
) -> Callable[[AnyCallableT], AnyCallableT]:
...
) -> Callable[[AnyCallableT], AnyCallableT]: ...

def inject_lambda_context(
self,
Expand Down
1 change: 1 addition & 0 deletions aws_lambda_powertools/metrics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""CloudWatch Embedded Metric Format utility
"""

from aws_lambda_powertools.metrics.base import MetricResolution, MetricUnit, single_metric
from aws_lambda_powertools.metrics.exceptions import (
MetricResolutionError,
Expand Down
1 change: 1 addition & 0 deletions aws_lambda_powertools/middleware_factory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Utilities to enhance middlewares """

from .factory import lambda_handler_decorator

__all__ = ["lambda_handler_decorator"]
9 changes: 3 additions & 6 deletions aws_lambda_powertools/shared/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,15 @@ def resolve_max_age(env: str, choice: Optional[int]) -> int:


@overload
def resolve_env_var_choice(env: Optional[str], choice: float) -> float:
...
def resolve_env_var_choice(env: Optional[str], choice: float) -> float: ...


@overload
def resolve_env_var_choice(env: Optional[str], choice: str) -> str:
...
def resolve_env_var_choice(env: Optional[str], choice: str) -> str: ...


@overload
def resolve_env_var_choice(env: Optional[str], choice: Optional[str]) -> str:
...
def resolve_env_var_choice(env: Optional[str], choice: Optional[str]) -> str: ...


def resolve_env_var_choice(
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_powertools/tracing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tracing utility
"""


from .extensions import aiohttp_trace_config
from .tracer import Tracer

Expand Down
6 changes: 2 additions & 4 deletions aws_lambda_powertools/tracing/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,15 @@ def decorate(event, context, **kwargs):

# see #465
@overload
def capture_method(self, method: "AnyCallableT") -> "AnyCallableT":
... # pragma: no cover
def capture_method(self, method: "AnyCallableT") -> "AnyCallableT": ... # pragma: no cover

@overload
def capture_method(
self,
method: None = None,
capture_response: Optional[bool] = None,
capture_error: Optional[bool] = None,
) -> Callable[["AnyCallableT"], "AnyCallableT"]:
... # pragma: no cover
) -> Callable[["AnyCallableT"], "AnyCallableT"]: ... # pragma: no cover

def capture_method(
self,
Expand Down
11 changes: 7 additions & 4 deletions aws_lambda_powertools/utilities/batch/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,15 @@ def _collect_dynamodb_failures(self):
return failures

@overload
def _to_batch_type(self, record: dict, event_type: EventType, model: "BatchTypeModels") -> "BatchTypeModels":
... # pragma: no cover
def _to_batch_type(
self,
record: dict,
event_type: EventType,
model: "BatchTypeModels",
) -> "BatchTypeModels": ... # pragma: no cover

@overload
def _to_batch_type(self, record: dict, event_type: EventType) -> EventSourceDataClassTypes:
... # pragma: no cover
def _to_batch_type(self, record: dict, event_type: EventType) -> EventSourceDataClassTypes: ... # pragma: no cover

def _to_batch_type(self, record: dict, event_type: EventType, model: Optional["BatchTypeModels"] = None):
if model is not None:
Expand Down
1 change: 1 addition & 0 deletions aws_lambda_powertools/utilities/batch/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Batch processing exceptions
"""

from __future__ import annotations

import traceback
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 @@ -193,7 +193,7 @@ def get_multi_value_query_string_values(
self,
name: str,
default_values: Optional[List[str]] = None,
) ->List[str]:
) -> List[str]:
"""Get multi-value query string parameter values by name

Parameters
Expand Down
12 changes: 4 additions & 8 deletions aws_lambda_powertools/utilities/data_masking/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,16 @@ def decrypt(
)

@overload
def erase(self, data, fields: None) -> str:
...
def erase(self, data, fields: None) -> str: ...

@overload
def erase(self, data: list, fields: list[str]) -> list[str]:
...
def erase(self, data: list, fields: list[str]) -> list[str]: ...

@overload
def erase(self, data: tuple, fields: list[str]) -> tuple[str]:
...
def erase(self, data: tuple, fields: list[str]) -> tuple[str]: ...

@overload
def erase(self, data: dict, fields: list[str]) -> dict:
...
def erase(self, data: dict, fields: list[str]) -> dict: ...

def erase(self, data: Sequence | Mapping, fields: list[str] | None = None) -> str | list[str] | tuple[str] | dict:
return self._apply_action(data=data, fields=fields, action=self.provider.erase)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def decrypt(self, data: str, provider_options: dict | None = None, **encryption_


class KMSKeyProvider:

"""
The KMSKeyProvider is responsible for assembling an AWS Key Management Service (KMS)
client, a caching mechanism, and a keyring for secure key management and data encryption.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Idempotency errors
"""


from typing import Optional, Union

from aws_lambda_powertools.utilities.idempotency.persistence.datarecord import DataRecord
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Primary interface for idempotent Lambda functions utility
"""

import functools
import logging
import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Serialization for supporting idempotency
"""

from abc import ABC, abstractmethod
from typing import Any, Dict

Expand Down
1 change: 0 additions & 1 deletion aws_lambda_powertools/utilities/parameters/appconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
AWS App Config configuration retrieval and caching utility
"""


import os
from typing import TYPE_CHECKING, Any, Dict, Optional, Union

Expand Down
7 changes: 3 additions & 4 deletions aws_lambda_powertools/utilities/parameters/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Base for Parameter providers
"""

from __future__ import annotations

import base64
Expand Down Expand Up @@ -372,8 +373,7 @@ def transform_value(
transform: TransformOptions,
raise_on_transform_error: bool = False,
key: str = "",
) -> Dict[str, Any]:
...
) -> Dict[str, Any]: ...


@overload
Expand All @@ -382,8 +382,7 @@ def transform_value(
transform: TransformOptions,
raise_on_transform_error: bool = False,
key: str = "",
) -> Optional[Union[str, bytes, Dict[str, Any]]]:
...
) -> Optional[Union[str, bytes, Dict[str, Any]]]: ...


def transform_value(
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_powertools/utilities/parameters/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Amazon DynamoDB parameter retrieval and caching utility
"""


from typing import TYPE_CHECKING, Dict, Optional

import boto3
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_powertools/utilities/parameters/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
AWS Secrets Manager parameter retrieval and caching utility
"""


import os
from typing import TYPE_CHECKING, Any, Dict, Optional, Union

Expand Down
37 changes: 13 additions & 24 deletions aws_lambda_powertools/utilities/parameters/ssm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
AWS SSM Parameter retrieval and caching utility
"""

from __future__ import annotations

import os
Expand Down Expand Up @@ -553,8 +554,7 @@ def get_parameter(
force_fetch: bool = False,
max_age: Optional[int] = None,
**sdk_options,
) -> str:
...
) -> str: ...


@overload
Expand All @@ -565,8 +565,7 @@ def get_parameter(
force_fetch: bool = False,
max_age: Optional[int] = None,
**sdk_options,
) -> dict:
...
) -> dict: ...


@overload
Expand All @@ -577,8 +576,7 @@ def get_parameter(
force_fetch: bool = False,
max_age: Optional[int] = None,
**sdk_options,
) -> Union[str, dict, bytes]:
...
) -> Union[str, dict, bytes]: ...


@overload
Expand All @@ -589,8 +587,7 @@ def get_parameter(
force_fetch: bool = False,
max_age: Optional[int] = None,
**sdk_options,
) -> bytes:
...
) -> bytes: ...


def get_parameter(
Expand Down Expand Up @@ -683,8 +680,7 @@ def get_parameters(
max_age: Optional[int] = None,
raise_on_transform_error: bool = False,
**sdk_options,
) -> Dict[str, str]:
...
) -> Dict[str, str]: ...


@overload
Expand All @@ -697,8 +693,7 @@ def get_parameters(
max_age: Optional[int] = None,
raise_on_transform_error: bool = False,
**sdk_options,
) -> Dict[str, dict]:
...
) -> Dict[str, dict]: ...


@overload
Expand All @@ -711,8 +706,7 @@ def get_parameters(
max_age: Optional[int] = None,
raise_on_transform_error: bool = False,
**sdk_options,
) -> Dict[str, bytes]:
...
) -> Dict[str, bytes]: ...


@overload
Expand All @@ -725,8 +719,7 @@ def get_parameters(
max_age: Optional[int] = None,
raise_on_transform_error: bool = False,
**sdk_options,
) -> Union[Dict[str, bytes], Dict[str, dict], Dict[str, str]]:
...
) -> Union[Dict[str, bytes], Dict[str, dict], Dict[str, str]]: ...


def get_parameters(
Expand Down Expand Up @@ -825,8 +818,7 @@ def get_parameters_by_name(
decrypt: Optional[bool] = None,
max_age: Optional[int] = None,
raise_on_error: bool = True,
) -> Dict[str, str]:
...
) -> Dict[str, str]: ...


@overload
Expand All @@ -836,8 +828,7 @@ def get_parameters_by_name(
decrypt: Optional[bool] = None,
max_age: Optional[int] = None,
raise_on_error: bool = True,
) -> Dict[str, bytes]:
...
) -> Dict[str, bytes]: ...


@overload
Expand All @@ -847,8 +838,7 @@ def get_parameters_by_name(
decrypt: Optional[bool] = None,
max_age: Optional[int] = None,
raise_on_error: bool = True,
) -> Dict[str, Dict[str, Any]]:
...
) -> Dict[str, Dict[str, Any]]: ...


@overload
Expand All @@ -858,8 +848,7 @@ def get_parameters_by_name(
decrypt: Optional[bool] = None,
max_age: Optional[int] = None,
raise_on_error: bool = True,
) -> Union[Dict[str, str], Dict[str, dict]]:
...
) -> Union[Dict[str, str], Dict[str, dict]]: ...


def get_parameters_by_name(
Expand Down
1 change: 1 addition & 0 deletions aws_lambda_powertools/utilities/parser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Advanced event_parser utility
"""

from . import envelopes
from .envelopes import BaseEnvelope
from .parser import event_parser, parse
Expand Down
6 changes: 2 additions & 4 deletions aws_lambda_powertools/utilities/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,11 @@ def handler(event: Order, context: LambdaContext):


@overload
def parse(event: Dict[str, Any], model: Type[Model]) -> Model:
... # pragma: no cover
def parse(event: Dict[str, Any], model: Type[Model]) -> Model: ... # pragma: no cover


@overload
def parse(event: Dict[str, Any], model: Type[Model], envelope: Type[Envelope]) -> Model:
... # pragma: no cover
def parse(event: Dict[str, Any], model: Type[Model], envelope: Type[Envelope]) -> Model: ... # pragma: no cover


def parse(event: Dict[str, Any], model: Type[Model], envelope: Optional[Type[Envelope]] = None):
Expand Down
1 change: 1 addition & 0 deletions aws_lambda_powertools/utilities/serialization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Standalone functions to serialize/deserialize common data structures"""

import base64
import json
from typing import Any, Callable
Expand Down
Loading