From 4acad71c8f9179bb93226bf1aff778d3a3ff5178 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 02:38:50 +0000 Subject: [PATCH] fix: address code review feedback - fix type hint and rename test Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/tasks/watch_folder_tasks.py | 3 ++- tests/test_watch_folder_tasks.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/tasks/watch_folder_tasks.py b/app/tasks/watch_folder_tasks.py index f01feabd..cbd4338a 100644 --- a/app/tasks/watch_folder_tasks.py +++ b/app/tasks/watch_folder_tasks.py @@ -16,6 +16,7 @@ import json import logging import os from datetime import datetime, timedelta, timezone +from typing import Any import redis from celery import shared_task @@ -1429,7 +1430,7 @@ def _scan_user_watch_folder( # --------------------------------------------------------------------------- # Maps source_type values to their per-user scan functions. -_USER_WF_CLOUD_HANDLERS: dict[str, callable] = {} # populated after function defs +_USER_WF_CLOUD_HANDLERS: dict[str, Any] = {} # populated after function defs def _scan_user_s3_folder( diff --git a/tests/test_watch_folder_tasks.py b/tests/test_watch_folder_tasks.py index 72a08423..40bc2d22 100644 --- a/tests/test_watch_folder_tasks.py +++ b/tests/test_watch_folder_tasks.py @@ -3950,7 +3950,9 @@ class TestPullUserIntegrationWatchFolders: @patch("app.tasks.watch_folder_tasks._scan_user_watch_folder", return_value=4) @patch("app.tasks.watch_folder_tasks._load_cache", return_value={}) @patch("app.tasks.watch_folder_tasks._save_cache") - def test_local_source_type_uses_local_scanner(self, mock_save, mock_load, mock_scan_local, mock_session_factory): + def test_local_source_type_dispatches_to_local_scanner( + self, mock_save, mock_load, mock_scan_local, mock_session_factory + ): """Explicit source_type 'local' should use the local filesystem scanner.""" from app.tasks.watch_folder_tasks import _pull_user_integration_watch_folders