Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Skip pagination if nothing to paginate (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
suchintan committed Oct 3, 2023
1 parent 647deaf commit 0db764d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wyvern-ai"
version = "0.0.21"
version = "0.0.22"
description = ""
authors = ["Wyvern AI <info@wyvern.ai>"]
readme = "README.md"
Expand Down
4 changes: 4 additions & 0 deletions wyvern/components/pagination/pagination_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ async def execute(self, input: PaginationRequest[T], **kwargs) -> List[T]:
Returns:
The paginated entities.
"""
if len(input.entities) == 0:
logger.info("Found no entities to paginate, skipping pagination")
return []

user_page = input.pagination_fields.user_page
candidate_page = input.pagination_fields.candidate_page
candidate_page_size = input.pagination_fields.candidate_page_size
Expand Down

0 comments on commit 0db764d

Please sign in to comment.