From b7d945671161ea853f7d2d12ab0fa9995b285588 Mon Sep 17 00:00:00 2001 From: Sergey Misuk Date: Tue, 5 Nov 2024 14:08:31 +0300 Subject: [PATCH] Fix rebase issues --- ...09_alter_config_face_distance_threshold.py | 25 ------------------- .../apps/api/migrations/0010_dedupjob.py | 2 +- tests/extras/testutils/duplicate_finders.py | 14 ++++++++--- 3 files changed, 11 insertions(+), 30 deletions(-) delete mode 100644 src/hope_dedup_engine/apps/api/migrations/0009_alter_config_face_distance_threshold.py diff --git a/src/hope_dedup_engine/apps/api/migrations/0009_alter_config_face_distance_threshold.py b/src/hope_dedup_engine/apps/api/migrations/0009_alter_config_face_distance_threshold.py deleted file mode 100644 index e85c8e4d..00000000 --- a/src/hope_dedup_engine/apps/api/migrations/0009_alter_config_face_distance_threshold.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 5.0.7 on 2024-10-30 12:32 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("api", "0008_ignoredfilenamepair"), - ] - - operations = [ - migrations.AlterField( - model_name="config", - name="face_distance_threshold", - field=models.FloatField( - null=True, - validators=[ - django.core.validators.MinValueValidator(0.1), - django.core.validators.MaxValueValidator(1.0), - ], - ), - ), - ] diff --git a/src/hope_dedup_engine/apps/api/migrations/0010_dedupjob.py b/src/hope_dedup_engine/apps/api/migrations/0010_dedupjob.py index 9f7af5cc..85f5c2e8 100644 --- a/src/hope_dedup_engine/apps/api/migrations/0010_dedupjob.py +++ b/src/hope_dedup_engine/apps/api/migrations/0010_dedupjob.py @@ -8,7 +8,7 @@ class Migration(migrations.Migration): dependencies = [ - ("api", "0009_alter_config_face_distance_threshold"), + ("api", "0009_remove_config_face_distance_threshold_config_name_and_more"), ] operations = [ diff --git a/tests/extras/testutils/duplicate_finders.py b/tests/extras/testutils/duplicate_finders.py index 605ab7aa..6c2c80d6 100644 --- a/tests/extras/testutils/duplicate_finders.py +++ b/tests/extras/testutils/duplicate_finders.py @@ -1,4 +1,4 @@ -from collections.abc import Generator +from collections.abc import Callable, Generator from itertools import combinations from hope_dedup_engine.apps.api.deduplication.registry import DuplicateKeyPair @@ -11,7 +11,9 @@ class AllDuplicateFinder: def __init__(self, deduplication_set: DeduplicationSet) -> None: self.deduplication_set = deduplication_set - def run(self) -> Generator[DuplicateKeyPair, None, None]: + def run( + self, _: Callable[[int], None] | None = None + ) -> Generator[DuplicateKeyPair, None, None]: reference_pks = self.deduplication_set.image_set.values_list( "reference_pk", flat=True ).order_by("reference_pk") @@ -22,7 +24,9 @@ def run(self) -> Generator[DuplicateKeyPair, None, None]: class NoDuplicateFinder: weight = 1 - def run(self) -> Generator[DuplicateKeyPair, None, None]: + def run( + self, _: Callable[[int], None] | None = None + ) -> Generator[DuplicateKeyPair, None, None]: # empty generator return yield @@ -31,5 +35,7 @@ def run(self) -> Generator[DuplicateKeyPair, None, None]: class FailingDuplicateFinder: weight = 1 - def run(self) -> Generator[DuplicateKeyPair, None, None]: + def run( + self, _: Callable[[int], None] | None = None + ) -> Generator[DuplicateKeyPair, None, None]: raise Exception