Skip to content

Commit

Permalink
Fix type errors introduced in #201
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Aug 21, 2024
1 parent b0487ca commit f0d176a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions watchtower/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from collections.abc import Mapping
from datetime import date, datetime, timezone
from operator import itemgetter
from typing import Any, Callable, List, Optional, Tuple
from typing import Any, Callable, Dict, List, Optional, Tuple

import boto3
import botocore
Expand Down Expand Up @@ -213,7 +213,7 @@ def __init__(
boto3_client: botocore.client.BaseClient = None,
boto3_profile_name: Optional[str] = None,
create_log_group: bool = True,
log_group_tags: dict[str, str] = {},
log_group_tags: Dict[str, str] = {},
json_serialize_default: Optional[Callable] = None,
log_group_retention_days: Optional[int] = None,
create_log_stream: bool = True,
Expand Down Expand Up @@ -300,15 +300,15 @@ def _ensure_log_group(self):
pass
self._idempotent_call("create_log_group", logGroupName=self.log_group_name)

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

def _tag_log_group(self, log_group_tags: dict[str, str]):
def _tag_log_group(self, log_group_tags: Dict[str, str]):
try:
self._idempotent_call("tag_resource", resourceArn=self._get_log_group_arn(), tags=log_group_tags)
except (
Expand Down

0 comments on commit f0d176a

Please sign in to comment.