Skip to content

Commit

Permalink
docs: add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Aug 31, 2023
1 parent 468c4f6 commit 279ced1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions robotoff/insights/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 279ced1

Please sign in to comment.