gendesign/backend/app/services/scrapers
lekss361 7863a99394 fix(22j): DEDUP domrf_kn_infrastructure + ON CONFLICT (issue #297)
Audit (2026-05-17): 496 153 total rows, 229 261 unique by
(obj_id, poi_category, poi_name, poi_address) = ~267k duplicates (~54%).
obj_id=65136 sample: 374 rows vs 192 on site = ×2 confirmed.

Root cause: old ON CONFLICT key included snapshot_date — each scrape run
inserted fresh rows for same POI. Accumulated ×N copies = N scrape runs.

Changes:
- data/sql/110_22j_dedup_infrastructure.sql: ONE-TIME cleanup keeping min(ctid)
  + DROP old constraint + ADD UNIQUE NULLS NOT DISTINCT (PG16) for nullable
  poi_category/poi_address.
- backend/app/services/scrapers/domrf_kn.py UPSERT_INFRA_SQL: ON CONFLICT
  (obj_id, poi_category, poi_name, poi_address) DO NOTHING — without snapshot_date.

Closes issue #297 sub-task 22j.
2026-05-17 18:12:14 +03:00
..
__init__.py add interactive parser of наш.дом.рф ЖК+flats with stealth Playwright 2026-04-27 17:58:40 +03:00
domrf_kn.py fix(22j): DEDUP domrf_kn_infrastructure + ON CONFLICT (issue #297) 2026-05-17 18:12:14 +03:00
ekburg_permits.py fix(#242): ekburg_permits SSL — verify=False для CA Минцифры РФ 2026-05-17 08:57:42 +03:00
nspd_client.py fix(#231): repair test_rate_limit_semaphore regression + docstring sync 2026-05-17 10:22:16 +03:00
nspd_denorm.py feat(#126): Sub-PR A — NSPDClient.get_features_in_bbox_grid + engineering classifier (#247) 2026-05-17 05:54:30 +00:00
nspd_lite.py fix(nspd-geo): rosreestr2coord v5 compat — delay arg, tmp cache, dumps default 2026-05-11 14:43:44 +03:00
objective.py feat(objective): integrate api.objctv.ru — auth, schema, weekly sync 2026-05-07 21:04:00 +03:00
stealth.py add domrf extras parser (sale_graph + sales_agg + infra + photos) + 2026-04-27 18:35:46 +03:00