From db9ee89ffa77445e8a1c641ccf45ca0beb9b5c7d Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 3 Sep 2026 23:09:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(dedup):=20ruff=20lint=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20=E2=80=94=20=E6=9C=AA=E4=BD=BF=E7=94=A8=E5=8F=98=E9=87=8F=20?= =?UTF-8?q?+=20zip=20strict=20+=20=E5=86=97=E4=BD=99=20import=20(#1659)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/worker/video_processing/dedup.py | 4 ++-- tests/unit/test_cross_video_avoidance.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/worker/video_processing/dedup.py b/apps/worker/video_processing/dedup.py index c90fa926d..3cc3468ab 100755 --- a/apps/worker/video_processing/dedup.py +++ b/apps/worker/video_processing/dedup.py @@ -353,7 +353,7 @@ def find_duplicate_segments( run_start = None gap_count = 0 - for i, (is_match, dist, idx) in enumerate(frame_matches): + for i, (is_match, _dist, _idx) in enumerate(frame_matches): if is_match: if run_start is None: run_start = i @@ -531,7 +531,7 @@ class VideoDeduplicator: min_len = min(len(hist_a), len(hist_b)) a = hist_a[:min_len] b = hist_b[:min_len] - return float(sum(np.sqrt(ai * bi) for ai, bi in zip(a, b))) + return float(sum(np.sqrt(ai * bi) for ai, bi in zip(a, b, strict=False))) @staticmethod def _compute_histogram_similarity( diff --git a/tests/unit/test_cross_video_avoidance.py b/tests/unit/test_cross_video_avoidance.py index 316e105ee..dac04378f 100644 --- a/tests/unit/test_cross_video_avoidance.py +++ b/tests/unit/test_cross_video_avoidance.py @@ -221,7 +221,6 @@ class TestServiceLayerIntegration: def _make_service(self, clip_repo_mock, asset_repo_mock=None): """创建 PlanGeneratorService 并注入 mock repos.""" - from unittest.mock import MagicMock, patch from apps.api.app.services.plan_generator_service import PlanGeneratorService