Fix: List index bug in outlier detection, add error logging

Bug #1: Fixed IndexError in outlier_detection.py:256
- Missing enumerate() caused stale loop var to access beyond bounds
- Occurred when hard bounds filtered deals before IQR processing
- Added test reproducing exact scenario (21 deals → 8 filtered)

Bug #2: Added stack traces to all MCP tool error logs
- Added exc_info=True to 10 MCP tools' error handlers
- Improves debugging by logging full stack traces

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Nitzan Pomerantz
2025-12-06 19:56:15 +02:00
parent 0e99dfddd2
commit 5daaf70021
3 changed files with 52 additions and 11 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ def filter_deals_for_analysis(
if metric == "price_per_sqm":
values = [
deal.price_per_sqm
for deal in deals
for i, deal in enumerate(deals)
if deal.price_per_sqm is not None and not filters_to_remove[i]
]
value_indices = [