diff --git a/src/cloudstorage/drivers/amazon.py b/src/cloudstorage/drivers/amazon.py index b21f6f1..7ebc6fe 100644 --- a/src/cloudstorage/drivers/amazon.py +++ b/src/cloudstorage/drivers/amazon.py @@ -2,6 +2,7 @@ import logging from typing import Any, Dict, Iterable, List, TYPE_CHECKING # noqa: F401 from urllib.parse import quote, urljoin +from functools import lru_cache import boto3 from botocore.exceptions import ClientError, ParamValidationError, WaiterError @@ -108,6 +109,7 @@ def _normalize_parameters( return normalized + @lru_cache def _get_bucket(self, bucket_name: str, validate: bool = True): """Get a S3 bucket.