|
All checks were successful
CI / changes (push) Successful in 6s
CI / frontend-tests (push) Has been skipped
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (pull_request) Has been skipped
CI / backend-tests (push) Successful in 6m27s
CI / backend-tests (pull_request) Successful in 6m27s
Fallback flat_id в _norm_flat использовал abs(hash(elem)) % (2**63 - 1). В CPython hash(str) РАНДОМИЗИРОВАН per-process (PYTHONHASHSEED нигде в репо не зафиксирован — uvicorn/celery не выставляют его). Эффект: - При resume упавшего sweep (resume_kn_run в новом процессе воркера) до 10 объектов после checkpoint перечитываются. Квартиры без flatId получают ДРУГОЙ hash-id → ON CONFLICT (id, snapshot_date) не срабатывает → дубли строк одной квартиры в одном snapshot. - То же при повторном прогоне за ту же дату — каждый раз новый id. - Дубли инфлируют все агрегации (units_sold/price медианы, supply_layers). Patch: - abs(hash(elem)) → int.from_bytes(sha256(elem)[:8], "big") % (2**63 - 1). - sha256 стабилен между процессами/перезапусками. 8 байт → BIGINT-fit. 6 новых юнит-тестов (test_domrf_kn_normalize.py): formula matches sha256, stable across calls, distinct elems→distinct ids, flatId wins over fallback, no-id→None, BIGINT-fit. ruff clean. Closes #1208 |
||
|---|---|---|
| .. | ||
| analysis_runs | ||
| cadastre | ||
| chat | ||
| exporters | ||
| forecasting | ||
| llm | ||
| scrapers | ||
| site_finder | ||
| __init__.py | ||
| test_cadastre_bulk.py | ||
| test_ekburg_permits.py | ||
| test_forecast_request_cache.py | ||
| test_functional_zone_lookup.py | ||
| test_granddoc_lookup.py | ||
| test_ird_analyze.py | ||
| test_ird_overlay_lookup.py | ||
| test_krt_lookup.py | ||
| test_newbuilding_crossload.py | ||
| test_nspd_denorm.py | ||
| test_objective_backfill.py | ||
| test_own_developer_ids_config.py | ||
| test_planning_lookup.py | ||
| test_quarter_dump_lookup.py | ||
| test_recommend_mix_velocity.py | ||
| test_reservation_lookup.py | ||
| test_weather_cache.py | ||
| test_zone_regulation_extract.py | ||