Skip to content

Commit

Permalink
Add deprecation warning when importing pymongo
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Dec 8, 2021
1 parent e765b95 commit 1df1b80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion optimade/server/entry_collections/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@


if CONFIG.database_backend.value == "mongodb":
from pymongo import MongoClient
from pymongo import MongoClient, version_tuple

if version_tuple[0] < 4:
LOGGER.warning(
"Support for pymongo<=3 (and thus MongoDB v3) is deprecated and will be "
"removed in the next minor release."
)

LOGGER.info("Using: Real MongoDB (pymongo)")

Expand Down

0 comments on commit 1df1b80

Please sign in to comment.