Skip to content

chore(deps-dev): bump mypy from 0.982 to 1.1.1 #1985

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 3 commits into from
Mar 13, 2023
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
4 changes: 2 additions & 2 deletions aws_lambda_powertools/logging/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(
self.use_rfc3339_iso8601 = use_rfc3339

if self.utc:
self.converter = time.gmtime # type: ignore
self.converter = time.gmtime

super(LambdaPowertoolsFormatter, self).__init__(datefmt=self.datefmt)

Expand Down Expand Up @@ -176,7 +176,7 @@ def formatTime(self, record: logging.LogRecord, datefmt: Optional[str] = None) -
return ts_as_datetime.isoformat(timespec="milliseconds") # 2022-10-27T17:42:26.841+0200

# converts to local/UTC TZ as struct time
record_ts = self.converter(record.created) # type: ignore
record_ts = self.converter(record.created)

if datefmt is None: # pragma: no cover, it'll always be None in std logging, but mypy
datefmt = self.datefmt
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/tracing/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ async def async_tasks():
return self._decorate_generator_function(
method=method, capture_response=capture_response, capture_error=capture_error, method_name=method_name
)
elif hasattr(method, "__wrapped__") and inspect.isgeneratorfunction(method.__wrapped__): # type: ignore
elif hasattr(method, "__wrapped__") and inspect.isgeneratorfunction(method.__wrapped__):
return self._decorate_generator_function_with_context_manager(
method=method, capture_response=capture_response, capture_error=capture_error, method_name=method_name
)
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parameters/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ def _get_multiple(self, path: str, **sdk_options) -> Dict[str, str]:

# maintenance: look for better ways to correctly type DynamoDB multiple return types
# without a breaking change within ABC return type
return {item[self.sort_attr]: item[self.value_attr] for item in items} # type: ignore[misc]
return {item[self.sort_attr]: item[self.value_attr] for item in items}
4 changes: 3 additions & 1 deletion aws_lambda_powertools/utilities/parser/envelopes/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def parse(self, data: Optional[Union[Dict[str, Any], Any]], model: Type[Model])
List of records parsed with model provided
"""
event_source = cast(dict, data).get("eventSource")
model_parse_event = KafkaMskEventModel if event_source == "aws:kafka" else KafkaSelfManagedEventModel
model_parse_event: Union[Type[KafkaMskEventModel], Type[KafkaSelfManagedEventModel]] = (
KafkaMskEventModel if event_source == "aws:kafka" else KafkaSelfManagedEventModel
)

logger.debug(f"Parsing incoming data with Kafka event model {model_parse_event}")
parsed_envelope = model_parse_event.parse_obj(data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io
import logging
from typing import IO, TYPE_CHECKING, AnyStr, Iterable, List, Optional
from typing import IO, TYPE_CHECKING, AnyStr, Iterable, List, Optional, cast

import boto3

Expand Down Expand Up @@ -85,7 +85,7 @@ def raw_stream(self) -> PowertoolsStreamingBody:
self._raw_stream = self.s3_client.get_object(Range=range_header, **self._sdk_options).get("Body")
self._closed = False

return self._raw_stream
return cast(PowertoolsStreamingBody, self._raw_stream)

def seek(self, offset: int, whence: int = io.SEEK_SET) -> int:
"""
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ warn_unused_ignores=True
show_column_numbers = True
show_error_codes = True
show_error_context = True
disable_error_code = annotation-unchecked

[mypy-jmespath]
ignore_missing_imports=True
Expand Down
63 changes: 33 additions & 30 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ aws-sdk = ["boto3"]

[tool.poetry.group.dev.dependencies]
cfn-lint = "0.74.1"
mypy = "^0.982"
mypy = ">=0.982,<1.2"
types-python-dateutil = "^2.8.19.6"
httpx = "^0.23.3"

Expand Down