From 8593a3c7112ea9171f7dd63b28cb6beb80d63377 Mon Sep 17 00:00:00 2001 From: Levi Szamek Date: Thu, 28 Nov 2024 15:08:51 +0100 Subject: [PATCH] fix: fixed tests and removed return of failed rows for download from mapillary --- mapswipe_workers/mapswipe_workers/utils/process_mapillary.py | 4 ++-- mapswipe_workers/tests/unittests/test_project_type_street.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mapswipe_workers/mapswipe_workers/utils/process_mapillary.py b/mapswipe_workers/mapswipe_workers/utils/process_mapillary.py index 3558e9b3..6cd77e78 100644 --- a/mapswipe_workers/mapswipe_workers/utils/process_mapillary.py +++ b/mapswipe_workers/mapswipe_workers/utils/process_mapillary.py @@ -85,13 +85,13 @@ def download_and_process_tile(row, attempt_limit=3): data = pd.DataFrame(data) if not data.empty: - return data, None + return data except Exception as e: print(f"An exception occurred while requesting a tile: {e}") attempt += 1 print(f"A tile could not be downloaded: {row}") - return None, row + return None def coordinate_download( diff --git a/mapswipe_workers/tests/unittests/test_project_type_street.py b/mapswipe_workers/tests/unittests/test_project_type_street.py index 64b80b3e..8ec8d0fa 100644 --- a/mapswipe_workers/tests/unittests/test_project_type_street.py +++ b/mapswipe_workers/tests/unittests/test_project_type_street.py @@ -34,7 +34,7 @@ def setUp(self) -> None: df = pd.read_csv(file) df['geometry'] = df['geometry'].apply(wkt.loads) - mock_get.return_value = (df, None) + mock_get.return_value = df self.project = StreetProject(project_draft) def test_init(self):