Skip to content

Commit f0d176a

Browse files
committed
Fix type errors introduced in #201
1 parent b0487ca commit f0d176a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

watchtower/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from collections.abc import Mapping
1212
from datetime import date, datetime, timezone
1313
from operator import itemgetter
14-
from typing import Any, Callable, List, Optional, Tuple
14+
from typing import Any, Callable, Dict, List, Optional, Tuple
1515

1616
import boto3
1717
import botocore
@@ -213,7 +213,7 @@ def __init__(
213213
boto3_client: botocore.client.BaseClient = None,
214214
boto3_profile_name: Optional[str] = None,
215215
create_log_group: bool = True,
216-
log_group_tags: dict[str, str] = {},
216+
log_group_tags: Dict[str, str] = {},
217217
json_serialize_default: Optional[Callable] = None,
218218
log_group_retention_days: Optional[int] = None,
219219
create_log_stream: bool = True,
@@ -300,15 +300,15 @@ def _ensure_log_group(self):
300300
pass
301301
self._idempotent_call("create_log_group", logGroupName=self.log_group_name)
302302

303-
@functools.cache
303+
@functools.lru_cache
304304
def _get_log_group_arn(self):
305305
# get the account number
306306
sts_client = boto3.client("sts")
307307
accountno = sts_client.get_caller_identity()["Account"]
308308
region = self.cwl_client.meta.region_name
309309
return f"arn:aws:logs:{region}:{accountno}:log-group:{self.log_group_name}"
310310

311-
def _tag_log_group(self, log_group_tags: dict[str, str]):
311+
def _tag_log_group(self, log_group_tags: Dict[str, str]):
312312
try:
313313
self._idempotent_call("tag_resource", resourceArn=self._get_log_group_arn(), tags=log_group_tags)
314314
except (

0 commit comments

Comments
 (0)