mypy compliant
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user