Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions agentic_core/schema_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ def _detect_metric_field(field_name, field_type, values):
if field_type not in ("integer", "float"):
return False
name_lower = field_name.lower()
# Skip ID-like numeric fields
if any(p in name_lower for p in ["_id", "id", "code", "编号", "year", "月", "日"]):
# Skip ID-like numeric fields. Match "id"/"_id" precisely (standalone name
# or "_id" suffix) instead of as a substring, otherwise measurement fields
# such as "width", "humidity" or "grid_load" are wrongly excluded.
if name_lower == "id" or name_lower.endswith("_id"):
return False
if any(p in name_lower for p in ["code", "编号", "year", "月", "日"]):
return False
return True

Expand Down