Skip to content

Commit

Permalink
Remove page_token parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
vhaldemar committed Oct 31, 2024
1 parent 3f19371 commit 68da8fe
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 36 deletions.
7 changes: 1 addition & 6 deletions src/yandex_cloud_ml_sdk/_assistants/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ async def _list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[AssistantTypeT]:
page_token_ = get_defined_value(page_token, '')
page_token_ = ''
page_size_ = get_defined_value(page_size, 0)

async with self._client.get_service_stub(AssistantServiceStub, timeout=timeout) as stub:
Expand Down Expand Up @@ -198,12 +197,10 @@ async def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[AsyncAssistant]:
async for assistant in self._list(
page_size=page_size,
page_token=page_token,
timeout=timeout
):
yield assistant
Expand Down Expand Up @@ -263,11 +260,9 @@ def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> Iterator[Assistant]:
yield from self.__list(
page_size=page_size,
page_token=page_token,
timeout=timeout
)
7 changes: 1 addition & 6 deletions src/yandex_cloud_ml_sdk/_files/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ async def _list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[FileTypeT]:
page_token_ = get_defined_value(page_token, '')
page_token_ = ''
page_size_ = get_defined_value(page_size, 0)

async with self._client.get_service_stub(FileServiceStub, timeout=timeout) as stub:
Expand Down Expand Up @@ -198,12 +197,10 @@ async def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[AsyncFile]:
async for file in self._list(
page_size=page_size,
page_token=page_token,
timeout=timeout
):
yield file
Expand Down Expand Up @@ -278,11 +275,9 @@ def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> Iterator[File]:
yield from self.__list(
page_size=page_size,
page_token=page_token,
timeout=timeout
)
7 changes: 1 addition & 6 deletions src/yandex_cloud_ml_sdk/_runs/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ async def _list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[RunTypeT]:
page_token_ = get_defined_value(page_token, '')
page_token_ = ''
page_size_ = get_defined_value(page_size, 0)

async with self._client.get_service_stub(RunServiceStub, timeout=timeout) as stub:
Expand Down Expand Up @@ -181,12 +180,10 @@ async def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[AsyncRun]:
async for run in self._list(
page_size=page_size,
page_token=page_token,
timeout=timeout,
):
yield run
Expand Down Expand Up @@ -226,11 +223,9 @@ def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> Iterator[Run]:
yield from self.__list(
page_size=page_size,
page_token=page_token,
timeout=timeout,
)
7 changes: 1 addition & 6 deletions src/yandex_cloud_ml_sdk/_search_indexes/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ async def _list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[SearchIndexTypeT]:
page_token_ = get_defined_value(page_token, '')
page_token_ = ''
page_size_ = get_defined_value(page_size, 0)

async with self._client.get_service_stub(SearchIndexServiceStub, timeout=timeout) as stub:
Expand Down Expand Up @@ -176,12 +175,10 @@ async def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[AsyncSearchIndex]:
async for search_index in self._list(
page_size=page_size,
page_token=page_token,
timeout=timeout,
):
yield search_index
Expand Down Expand Up @@ -233,11 +230,9 @@ def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> Iterator[SearchIndex]:
yield from self.__list(
page_size=page_size,
page_token=page_token,
timeout=timeout,
)
7 changes: 1 addition & 6 deletions src/yandex_cloud_ml_sdk/_search_indexes/search_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,9 @@ async def _list_files(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[SearchIndexFile]:
page_token_ = get_defined_value(page_token, '')
page_token_ = ''
page_size_ = get_defined_value(page_size, 0)

async with self._client.get_service_stub(SearchIndexFileServiceStub, timeout=timeout) as stub:
Expand Down Expand Up @@ -219,12 +218,10 @@ async def list_files(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[SearchIndexFile]:
async for file in self._list_files(
page_size=page_size,
page_token=page_token,
timeout=timeout,
):
yield file
Expand Down Expand Up @@ -277,12 +274,10 @@ def list_files(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> Iterator[SearchIndexFile]:
yield from self.__list_files(
page_size=page_size,
page_token=page_token,
timeout=timeout,
)

Expand Down
7 changes: 1 addition & 6 deletions src/yandex_cloud_ml_sdk/_threads/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ async def _list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[ThreadTypeT]:
page_token_ = get_defined_value(page_token, '')
page_token_ = ''
page_size_ = get_defined_value(page_size, 0)

async with self._client.get_service_stub(ThreadServiceStub, timeout=timeout) as stub:
Expand Down Expand Up @@ -143,12 +142,10 @@ async def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> AsyncIterator[AsyncThread]:
async for thread in self._list(
page_size=page_size,
page_token=page_token,
timeout=timeout
):
yield thread
Expand Down Expand Up @@ -195,11 +192,9 @@ def list(
self,
*,
page_size: UndefinedOr[int] = UNDEFINED,
page_token: UndefinedOr[str] = UNDEFINED,
timeout: float = 60
) -> Iterator[Thread]:
yield from self.__list(
page_size=page_size,
page_token=page_token,
timeout=timeout
)

0 comments on commit 68da8fe

Please sign in to comment.