From 279ced16115d3da5b6616d4d71ef1723bf2543af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Thu, 31 Aug 2023 17:28:07 +0200 Subject: [PATCH] docs: add docstring --- robotoff/insights/importer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/robotoff/insights/importer.py b/robotoff/insights/importer.py index b157bfee22..de960c2a80 100644 --- a/robotoff/insights/importer.py +++ b/robotoff/insights/importer.py @@ -1978,6 +1978,15 @@ def get_product_predictions( server_type: ServerType, prediction_types: Optional[list[str]] = None, ) -> Iterator[dict]: + """Fetch from DB predictions with barcode in `barcodes`. + + :param barcodes: the barcodes we want to fetch + predictions for. + :param server_type: filter by server type (project) + :param prediction_types: filter by prediction types, defaults to None + (fetch all types) + :yield: predictions as dict + """ where_clauses = [ PredictionModel.barcode.in_(barcodes), PredictionModel.server_type == server_type.name,