From 8161016920594250a36cf1deea71f296f87bab25 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:22:31 +0000 Subject: [PATCH 1/4] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.5 → v0.6.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.5...v0.6.8) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f317512..22f4984 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ fail_fast: false repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.6.5' + rev: 'v0.6.8' hooks: - id: ruff - repo: https://github.com/pre-commit/pre-commit-hooks From 0f94a0789e00358ed53a4c2ce9c3a1c0d9c10b37 Mon Sep 17 00:00:00 2001 From: pkhalaj <11797985+pkhalaj@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:05:38 +0200 Subject: [PATCH 2/4] Fix `_DocumentType` import error in `mongodb.py` Previously `_DocumentType` was a part of `pymongo.collection`, however, it is now a part of `pymongo.typings`. --- trolldb/database/mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trolldb/database/mongodb.py b/trolldb/database/mongodb.py index 3b01379..028085e 100644 --- a/trolldb/database/mongodb.py +++ b/trolldb/database/mongodb.py @@ -23,7 +23,7 @@ AsyncIOMotorDatabase, ) from pydantic import validate_call -from pymongo.collection import _DocumentType +from pymongo.typings import _DocumentType from pymongo.errors import ConnectionFailure, ServerSelectionTimeoutError from trolldb.config.config import DatabaseConfig From 1ba3f3588e9883c6f27415ee3eecb8a75f43933b Mon Sep 17 00:00:00 2001 From: pkhalaj <11797985+pkhalaj@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:09:25 +0200 Subject: [PATCH 3/4] Fix `_DocumentType` import error in `databases.py` Previously `_DocumentType` was a part of `pymongo.collection`, however, it is now a part of `pymongo.typings`. --- trolldb/api/routes/databases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trolldb/api/routes/databases.py b/trolldb/api/routes/databases.py index 60e3ab5..ebe7052 100644 --- a/trolldb/api/routes/databases.py +++ b/trolldb/api/routes/databases.py @@ -7,7 +7,7 @@ from typing import Annotated from fastapi import APIRouter, Query -from pymongo.collection import _DocumentType +from pymongo.typings import _DocumentType from trolldb.api.routes.common import CheckCollectionDependency, CheckDataBaseDependency from trolldb.config.config import MongoObjectId From 8facc0022d99556244f401c6a790596ec9fcbd3d Mon Sep 17 00:00:00 2001 From: pkhalaj <11797985+pkhalaj@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:17:35 +0200 Subject: [PATCH 4/4] Make ruff happy --- trolldb/database/mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trolldb/database/mongodb.py b/trolldb/database/mongodb.py index 028085e..f6ccbd5 100644 --- a/trolldb/database/mongodb.py +++ b/trolldb/database/mongodb.py @@ -23,8 +23,8 @@ AsyncIOMotorDatabase, ) from pydantic import validate_call -from pymongo.typings import _DocumentType from pymongo.errors import ConnectionFailure, ServerSelectionTimeoutError +from pymongo.typings import _DocumentType from trolldb.config.config import DatabaseConfig from trolldb.database.errors import Client, Collections, Databases