Skip to content

Commit

Permalink
fix: suppress mypy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Apr 16, 2023
1 parent d363cf8 commit 49a29b9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions robotoff/scheduler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


# Note: we do not use with_db, for atomicity is handled in annotator
def process_insights():
def process_insights() -> None:
with db.connection_context():
processed = 0
insight: ProductInsight
Expand Down Expand Up @@ -79,7 +79,7 @@ def process_insights():


@with_db
def refresh_insights(with_deletion: bool = True):
def refresh_insights(with_deletion: bool = True) -> None:
product_store = get_min_product_store(
["code", "brands_tags", "countries_tags", "unique_scans_n"]
)
Expand Down Expand Up @@ -234,7 +234,7 @@ def _update_data():
logger.exception("Exception during ES indices creation", exc_info=e)


def generate_insights():
def generate_insights() -> None:
"""Generate and import category insights from the latest dataset dump, for
products added at day-1."""
logger.info("Generating new category insights")
Expand Down
2 changes: 1 addition & 1 deletion robotoff/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __repr__(self):


class Taxonomy:
def __init__(self):
def __init__(self) -> None:
self.nodes: dict[str, TaxonomyNode] = {}

def add(self, key: str, node: TaxonomyNode) -> None:
Expand Down
2 changes: 1 addition & 1 deletion robotoff/utils/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class TranslationStore:
def __init__(self):
def __init__(self) -> None:
self.translations: dict[str, gettext.NullTranslations] = {}

def load(self):
Expand Down
2 changes: 1 addition & 1 deletion scripts/clean_insights.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def check_field(insight: ProductInsight, field_name: str):
return False


def run():
def run() -> None:
count = 0
errors = 0
insight: ProductInsight
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/prediction/ocr/test_brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def test_check_logo_annotation_brands():
items: set[str] = set()
items = set()

for item in text_file_iter(settings.OCR_LOGO_ANNOTATION_BRANDS_DATA_PATH):
assert "||" in item
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/prediction/ocr/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from robotoff.utils import text_file_iter


def test_check_ocr_stores():
def test_check_ocr_stores() -> None:
stores: set[str] = set()
items: set[str] = set()

Expand Down

0 comments on commit 49a29b9

Please sign in to comment.