Skip to content

Commit

Permalink
Fix the iteration helpers type annotations
Browse files Browse the repository at this point in the history
Our generators do not yield lists, they yield whatever the function
they wrap returns.

Fixes #253
  • Loading branch information
ramnes committed Jan 15, 2025
1 parent 9c8f022 commit 1fb34b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notion_client/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_id(url: str) -> str:

def iterate_paginated_api(
function: Callable[..., Any], **kwargs: Any
) -> Generator[List[Any], None, None]:
) -> Generator[Any, None, None]:
"""Return an iterator over the results of any paginated Notion API."""
next_cursor = kwargs.pop("start_cursor", None)

Expand All @@ -57,7 +57,7 @@ def collect_paginated_api(function: Callable[..., Any], **kwargs: Any) -> List[A

async def async_iterate_paginated_api(
function: Callable[..., Awaitable[Any]], **kwargs: Any
) -> AsyncGenerator[List[Any], None]:
) -> AsyncGenerator[Any, None]:
"""Return an async iterator over the results of any paginated Notion API."""
next_cursor = kwargs.pop("start_cursor", None)

Expand Down

0 comments on commit 1fb34b5

Please sign in to comment.