Per PR #155 bot review — мой db.rollback() в catches был НЕПРАВИЛЬНЫЙ. Session.rollback() = ENTIRE outer tx (не savepoint). Outer SAVEPOINT context становится orphaned → InvalidRequestError на __exit__. Correct fix: wrap каждый db.execute в свой with db.begin_nested(): - Failure → __exit__ propagates exception → SAVEPOINT rolls back - Outer tx остаётся clean - velocity returns None gracefully → caller продолжает Все 3 SQL queries в velocity.py теперь SAVEPOINT-wrapped: - compute_velocity: competitor_query - compute_velocity: sales_rows query - _get_ekb_median: median query db.rollback() removed из всех 3 catches. Refs: PR #155 bot review |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| cadastre_fetch.py | ||
| filters.py | ||
| gate_verdict.py | ||
| noise_loader.py | ||
| parser.py | ||
| poi_loader.py | ||
| pzz_loader.py | ||
| quarter_dump_lookup.py | ||
| scorer.py | ||
| velocity.py | ||
| weight_profiles.py | ||