From 5588360da110cd2e2824d69644fbb316a111d0cc Mon Sep 17 00:00:00 2001 From: Mathias Hansen Date: Fri, 9 Oct 2026 12:43:25 +0200 Subject: [PATCH] fix(progress): count each ESRI feature in one cell, not two The mapping step reports a cell for every feature it writes. The ESRI download step reported the same features again, so fetch-stage maps showed twice the real count on ESRI sources. The download step now reports only the features it skips, which never reach the mapping step. Claude-Session: https://claude.ai/code/session_014jDQfgEffxXkhD6rWYjpJr --- openaddr/cache.py | 2 -- openaddr/tests/cache.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/openaddr/cache.py b/openaddr/cache.py index bc18c360..348afe82 100644 --- a/openaddr/cache.py +++ b/openaddr/cache.py @@ -470,8 +470,6 @@ def download(self, source_urls, workdir, source_config): writer.writerow({fn: row.get(fn) for fn in field_names}) size += 1 progress.reporter.advance() - if point is not None: - progress.reporter.cell(point.x, point.y, 'ok') except TypeError: _L.debug("Skipping a geometry", exc_info=True) progress.reporter.count('skipped') diff --git a/openaddr/tests/cache.py b/openaddr/tests/cache.py index 13991eea..e5f85435 100644 --- a/openaddr/tests/cache.py +++ b/openaddr/tests/cache.py @@ -435,7 +435,7 @@ def test_esri_download_reports_progress(self): self.assertEqual(len(lines), 2) self.assertEqual((lines[0]['phase'], lines[0]['done'], lines[0]['total']), ('Downloading from ArcGIS', 0, 5)) self.assertEqual((lines[1]['done'], lines[1]['total']), (5, 5)) - self.assertEqual(sum(counts[0] for counts in lines[1]['cells'].values()), 5) + self.assertNotIn('cells', lines[1]) def test_skip_esri_features_with_nan_geometry(self): """ ESRI Caching Will Skip Features Whose Geometry Is The String "NaN" """