From e0233f6545c808649c55a1dcfb0d6106d612388d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:50:26 +0000 Subject: [PATCH 1/3] Bump beanie from 1.26.0 to 1.27.0 Bumps [beanie](https://github.com/roman-right/beanie) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/roman-right/beanie/releases) - [Changelog](https://github.com/BeanieODM/beanie/blob/main/docs/changelog.md) - [Commits](https://github.com/roman-right/beanie/compare/1.26.0...1.27.0) --- updated-dependencies: - dependency-name: beanie dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0f0394d2..c6c63131 100644 --- a/poetry.lock +++ b/poetry.lock @@ -182,13 +182,13 @@ tzdata = ["tzdata"] [[package]] name = "beanie" -version = "1.26.0" +version = "1.27.0" description = "Asynchronous Python ODM for MongoDB" optional = true python-versions = "<4.0,>=3.7" files = [ - {file = "beanie-1.26.0-py3-none-any.whl", hash = "sha256:b45926c01d4a899c519c665c2a5f230990717e99f7fd68172a389ca33e7693b9"}, - {file = "beanie-1.26.0.tar.gz", hash = "sha256:54016f4ec71ed0ea6ce0c7946a395090c45687f254dbbe1cf06eec608383f790"}, + {file = "beanie-1.27.0-py3-none-any.whl", hash = "sha256:2cc6762bdd59b9040dd004ecbc7d4fd5ddd22e52743915e38d1f0f92f276bcaf"}, + {file = "beanie-1.27.0.tar.gz", hash = "sha256:a5eee40f1e52214afeb8558c0823d7504856884770c3d56fc3cd5765efb87314"}, ] [package.dependencies] @@ -197,12 +197,19 @@ lazy-model = "0.2.0" motor = ">=2.5.0,<4.0.0" pydantic = ">=1.10,<3.0" toml = "*" -typing-extensions = {version = ">=4.7", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.7" [package.extras] +aws = ["motor[aws] (>=2.5.0,<4.0.0)"] +ci = ["requests", "toml", "types-requests"] doc = ["Markdown (>=3.3)", "Pygments (>=2.8.0)", "jinja2 (>=3.0.3)", "mkdocs (>=1.4)", "mkdocs-material (>=9.0)", "pydoc-markdown (>=4.8)"] +encryption = ["motor[encryption] (>=2.5.0,<4.0.0)"] +gssapi = ["motor[gssapi] (>=2.5.0,<4.0.0)"] +ocsp = ["motor[ocsp] (>=2.5.0,<4.0.0)"] queue = ["beanie-batteries-queue (>=0.2)"] +snappy = ["motor[snappy] (>=2.5.0,<4.0.0)"] test = ["asgi-lifespan (>=1.0.1)", "dnspython (>=2.1.0)", "fastapi (>=0.100)", "flake8 (>=3)", "httpx (>=0.23.0)", "pre-commit (>=2.3.0)", "pydantic-extra-types (>=2)", "pydantic-settings (>=2)", "pydantic[email]", "pyright (>=0)", "pytest (>=6.0.0)", "pytest-asyncio (>=0.21.0)", "pytest-cov (>=2.8.1)"] +zstd = ["motor[zstd] (>=2.5.0,<4.0.0)"] [[package]] name = "black" From 79bbc1684fb1b37e830ca17a015d0e2edf7322d3 Mon Sep 17 00:00:00 2001 From: Yurii Karabas <1998uriyyo@gmail.com> Date: Tue, 8 Oct 2024 18:53:32 +0200 Subject: [PATCH 2/3] Use correct import --- fastapi_pagination/ext/beanie.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fastapi_pagination/ext/beanie.py b/fastapi_pagination/ext/beanie.py index 745032b5..dfdb0d5b 100644 --- a/fastapi_pagination/ext/beanie.py +++ b/fastapi_pagination/ext/beanie.py @@ -1,10 +1,10 @@ __all__ = ["paginate"] -from typing import Any, List, Optional, Tuple, Type, TypeVar, Union +from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type, TypeVar, Union from beanie import Document from beanie.odm.enums import SortDirection -from beanie.odm.interfaces.aggregate import ClientSession, DocumentProjectionType +from beanie.odm.interfaces.aggregate import DocumentProjectionType from beanie.odm.queries.aggregation import AggregationQuery from beanie.odm.queries.find import FindMany @@ -13,6 +13,10 @@ from ..types import AdditionalData, AsyncItemsTransformer from ..utils import verify_params +if TYPE_CHECKING: + from motor.motor_asyncio import AsyncIOMotorClientSession + + TDocument = TypeVar("TDocument", bound=Document) @@ -24,7 +28,7 @@ async def paginate( additional_data: Optional[AdditionalData] = None, projection_model: Optional[Type[DocumentProjectionType]] = None, sort: Union[None, str, List[Tuple[str, SortDirection]]] = None, - session: Optional[ClientSession] = None, + session: Optional[AsyncIOMotorClientSession] = None, ignore_cache: bool = False, fetch_links: bool = False, lazy_parse: bool = False, From a948d6d1c0dc3ef26b93d1cf810cb631d240f144 Mon Sep 17 00:00:00 2001 From: Yurii Karabas <1998uriyyo@gmail.com> Date: Tue, 8 Oct 2024 18:56:25 +0200 Subject: [PATCH 3/3] Add missed import --- fastapi_pagination/ext/beanie.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastapi_pagination/ext/beanie.py b/fastapi_pagination/ext/beanie.py index dfdb0d5b..777902aa 100644 --- a/fastapi_pagination/ext/beanie.py +++ b/fastapi_pagination/ext/beanie.py @@ -1,3 +1,5 @@ +from __future__ import annotations + __all__ = ["paginate"] from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type, TypeVar, Union