Skip to content
Merged
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
13 changes: 7 additions & 6 deletions lithops/storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import logging
import itertools
import importlib
from typing import Optional, List, Union, Tuple, Dict, TextIO, BinaryIO, Any
from typing import Optional, List, Union, Dict, TextIO, BinaryIO, Any

from lithops.constants import CACHE_DIR, RUNTIMES_PREFIX, JOBS_PREFIX, TEMP_PREFIX
from lithops.utils import is_lithops_worker
Expand Down Expand Up @@ -219,16 +219,17 @@ def head_bucket(self, bucket: str) -> Dict:
def list_objects(self,
bucket: str,
prefix: Optional[str] = None,
match_pattern: Optional[str] = None) -> List[Tuple[str,
int]]:
match_pattern: Optional[str] = None) -> List[Dict[str,
Any]]:
"""
Returns all of the object keys in a bucket. For each object, the list contains the name
of the object (key) and the size.
Returns all of the object keys in a bucket. For each object, the list contains a dictionary
with at least the object key ('Key') and the size in bytes ('Size'). Additional fields may be
present, depending on the backend implementation.

:param bucket: Name of the bucket
:param prefix: Key prefix for filtering

:return: List of tuples containing the object key and size in bytes
:return: List of dictionaries containing at least 'Key' and 'Size' for each object
"""

return self.storage_handler.list_objects(bucket, prefix, match_pattern)
Expand Down