Skip to content

Commit 1fb34b5

Browse files
committed
Fix the iteration helpers type annotations
Our generators do not yield lists, they yield whatever the function they wrap returns. Fixes #253
1 parent 9c8f022 commit 1fb34b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notion_client/helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_id(url: str) -> str:
3636

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

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

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

0 commit comments

Comments
 (0)