corrected type hints
Code Quality Pipeline / Check Code (pull_request) Failing after 1m48s

This commit is contained in:
brian
2025-02-28 22:54:53 +00:00
parent 090a1cd8bb
commit 88a20c4b0b
4 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -40,7 +40,7 @@ class DocstoreMongo(DocstoreInterface):
mongo_database = str(os.getenv('MONGO_DB'))
mongo_collection = str(os.getenv('MONGO_COLLECTION'))
# connect client
client = MongoClient(mongo_endpoint)
client: MongoClient = MongoClient(mongo_endpoint)
database = client[mongo_database]
collection = database[mongo_collection]
# set unique index on 'name'
@@ -53,9 +53,9 @@ class DocstoreMongo(DocstoreInterface):
def close(self) -> None:
"""Close connection to Mongo server."""
self._client.close()
self._client = None
self._database = None
self._collection = None
self._client = None # type: ignore
self._database = None # type: ignore
self._collection = None # type: ignore
def __enter__(self) -> DocstoreMongo:
self.connect()