Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit ca806e6

Browse files
Merge pull request #96 from C4IROcean/fix/odp-1382-fix-names-page-limit
Fix/odp 1382 fix names page limit
2 parents 5a76185 + 2152766 commit ca806e6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/sdk/odp/client/raw_storage_client.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,18 @@ def list_paginated(
8080
resource_dto: DatasetDto,
8181
metadata_filter: Optional[Dict[str, Any]] = None,
8282
cursor: Optional[str] = None,
83-
limit: int = 1000,
83+
page_size: int = 1000,
84+
limit: int = 0,
8485
) -> Tuple[List[FileMetadataDto], str]:
8586
"""List page
8687
8788
Args:
8889
resource_dto: Dataset manifest
8990
metadata_filter: List filter
9091
cursor: Optional cursor for pagination
91-
limit: Optional limit for pagination
92+
limit: Optional #This argument will be deprecated, you should use page_size instead.
93+
This is used for backward compatibility. limit will be ignored.
94+
page_size: Optional limit for each page
9295
9396
Returns:
9497
Page of return values
@@ -99,8 +102,14 @@ def list_paginated(
99102

100103
if cursor:
101104
params["page"] = cursor
105+
if page_size:
106+
params["page_size"] = page_size
102107
if limit:
103-
params["limit"] = limit
108+
from warnings import warn
109+
110+
warn(
111+
"limit argument will be deprecated, you should use page_size instead", DeprecationWarning, stacklevel=2
112+
)
104113

105114
response = self.http_client.post(url, params=params, content=metadata_filter)
106115

0 commit comments

Comments
 (0)