From a7b86e7ed6536054e0dcdeca42435932dd9948e3 Mon Sep 17 00:00:00 2001 From: mohammadrezapourreza Date: Wed, 27 Sep 2023 14:14:48 -0400 Subject: [PATCH] DH-4724/reformat with black --- dataherald/db/__init__.py | 9 ++++++++- dataherald/db/mongo.py | 9 ++++++++- dataherald/tests/db/test_db.py | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dataherald/db/__init__.py b/dataherald/db/__init__.py index deb82185..4488ce4d 100644 --- a/dataherald/db/__init__.py +++ b/dataherald/db/__init__.py @@ -29,7 +29,14 @@ def find_by_id(self, collection: str, id: str) -> dict: pass @abstractmethod - def find(self, collection: str, query: dict, sort: list = None, page: int = 0, limit: int = 0) -> list: + def find( + self, + collection: str, + query: dict, + sort: list = None, + page: int = 0, + limit: int = 0, + ) -> list: pass @abstractmethod diff --git a/dataherald/db/mongo.py b/dataherald/db/mongo.py index 5508b5e8..b2a7a41a 100644 --- a/dataherald/db/mongo.py +++ b/dataherald/db/mongo.py @@ -40,7 +40,14 @@ def find_by_id(self, collection: str, id: str) -> dict: return self._data_store[collection].find_one({"_id": ObjectId(id)}) @override - def find(self, collection: str, query: dict, sort: list = None, page: int = 0, limit: int = 0) -> list: + def find( + self, + collection: str, + query: dict, + sort: list = None, + page: int = 0, + limit: int = 0, + ) -> list: skip_count = (page - 1) * limit cursor = self._data_store[collection].find(query) if sort: diff --git a/dataherald/tests/db/test_db.py b/dataherald/tests/db/test_db.py index c69e0aa3..a8056e20 100644 --- a/dataherald/tests/db/test_db.py +++ b/dataherald/tests/db/test_db.py @@ -55,7 +55,14 @@ def find_by_id(self, collection: str, id: str) -> dict: return None @override - def find(self, collection: str, query: dict, sort: list = None, page: int = 0, limit: int = 0) -> list: + def find( + self, + collection: str, + query: dict, + sort: list = None, + page: int = 0, + limit: int = 0, + ) -> list: return [] @override