Peter Mutwiri commited on
Commit ·
8a78694
1
Parent(s): 4cfab61
cleaned returned for json
Browse files- app/mapper.py +2 -1
app/mapper.py
CHANGED
|
@@ -483,7 +483,8 @@ def canonify_df(org_id: str, source_id: str, hours_window: int = 24) -> tuple[pd
|
|
| 483 |
print(f"[canonify] ✅ Schema v{version_id} marked as applied")
|
| 484 |
except Exception as e:
|
| 485 |
print(f"[canonify] ⚠️ Schema update warning (non-critical): {e}")
|
| 486 |
-
|
|
|
|
| 487 |
duration_ms = (datetime.now() - start_time).total_seconds() * 1000
|
| 488 |
print(f"[canonify] ✅ Pipeline complete in {duration_ms:.2f}ms for {org_id}")
|
| 489 |
|
|
|
|
| 483 |
print(f"[canonify] ✅ Schema v{version_id} marked as applied")
|
| 484 |
except Exception as e:
|
| 485 |
print(f"[canonify] ⚠️ Schema update warning (non-critical): {e}")
|
| 486 |
+
# At the very end of canonify_df function, line ~470
|
| 487 |
+
df = df.replace([np.inf, -np.inf, np.nan], None) # Clean for JSON response
|
| 488 |
duration_ms = (datetime.now() - start_time).total_seconds() * 1000
|
| 489 |
print(f"[canonify] ✅ Pipeline complete in {duration_ms:.2f}ms for {org_id}")
|
| 490 |
|