Skip to content

Commit a602457

Browse files
Merge pull request #1323 from uriyyo/dependabot/pip/beanie-1.27.0
[no ci]
2 parents 8a5ccfa + a948d6d commit a602457

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

fastapi_pagination/ext/beanie.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
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

57
from beanie import Document
68
from beanie.odm.enums import SortDirection
7-
from beanie.odm.interfaces.aggregate import ClientSession, DocumentProjectionType
9+
from beanie.odm.interfaces.aggregate import DocumentProjectionType
810
from beanie.odm.queries.aggregation import AggregationQuery
911
from beanie.odm.queries.find import FindMany
1012

@@ -13,6 +15,10 @@
1315
from ..types import AdditionalData, AsyncItemsTransformer
1416
from ..utils import verify_params
1517

18+
if TYPE_CHECKING:
19+
from motor.motor_asyncio import AsyncIOMotorClientSession
20+
21+
1622
TDocument = 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,

poetry.lock

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)