1+ from __future__ import annotations
2+
13__all__ = ["paginate" ]
24
3- from typing import Any , List , Optional , Tuple , Type , TypeVar , Union
5+ from typing import TYPE_CHECKING , Any , List , Optional , Tuple , Type , TypeVar , Union
46
57from beanie import Document
68from beanie .odm .enums import SortDirection
7- from beanie .odm .interfaces .aggregate import ClientSession , DocumentProjectionType
9+ from beanie .odm .interfaces .aggregate import DocumentProjectionType
810from beanie .odm .queries .aggregation import AggregationQuery
911from beanie .odm .queries .find import FindMany
1012
1315from ..types import AdditionalData , AsyncItemsTransformer
1416from ..utils import verify_params
1517
18+ if TYPE_CHECKING :
19+ from motor .motor_asyncio import AsyncIOMotorClientSession
20+
21+
1622TDocument = TypeVar ("TDocument" , bound = Document )
1723
1824
@@ -24,7 +30,7 @@ async def paginate(
2430 additional_data : Optional [AdditionalData ] = None ,
2531 projection_model : Optional [Type [DocumentProjectionType ]] = None ,
2632 sort : Union [None , str , List [Tuple [str , SortDirection ]]] = None ,
27- session : Optional [ClientSession ] = None ,
33+ session : Optional [AsyncIOMotorClientSession ] = None ,
2834 ignore_cache : bool = False ,
2935 fetch_links : bool = False ,
3036 lazy_parse : bool = False ,
0 commit comments