mypy compliant

This commit is contained in:
Brian Bjarke Jensen
2024-02-25 00:04:01 +01:00
parent 4719117d71
commit 8e107b785e
3 changed files with 8 additions and 9 deletions
+4 -5
View File
@@ -36,7 +36,7 @@ def get_visual_communication(
if with_annotation:
query["annotation"] = {"$ne": None}
else:
query["annotation"] = None
query["annotation"] = {"$eq": None}
data = collection.aggregate([
{
"$match": query # find using filters
@@ -47,13 +47,12 @@ def get_visual_communication(
}
}
])
data = list(data) # read data from cursor object
if len(data) == 0:
data_list = list(data) # read data from cursor object
if len(data_list) == 0:
logging.error("failed getting visual communication")
raise NoDocumentFoundException()
data = data[0]
logging.info("finished")
return VisualCommunication.model_validate(data)
return VisualCommunication.model_validate(data_list[0])
def upsert_predictions(