{"record":{"id":"a31c484aa3036a8b","repo":"HKUDS/Vibe-Trading","slug":"field-name-value-r-is-not-iso-8601-yyyy-mm-dd","errorCode":null,"errorMessage":"{field_name}={value!r} is not ISO-8601 (YYYY-MM-DD); pass an explicit date_format instead of relying on inference","messagePattern":"(.+?)=(.+?) is not ISO-8601 \\(YYYY-MM-DD\\); pass an explicit date_format instead of relying on inference","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/entities/models.py","lineNumber":131,"sourceCode":"    Raises:\n        ValueError: If the value is not a supported type or not ISO-8601.\n    \"\"\"\n    if isinstance(value, datetime):\n        return value.date()\n    if isinstance(value, date):\n        return value\n    if isinstance(value, str):\n        text = value.strip()\n        if not text:\n            raise ValueError(f\"{field_name} is required and cannot be empty\")\n        try:\n            return date.fromisoformat(text)\n        except ValueError:\n            pass\n        try:\n            return datetime.fromisoformat(text).date()\n        except ValueError as exc:\n            raise ValueError(\n                f\"{field_name}={value!r} is not ISO-8601 (YYYY-MM-DD); pass an \"\n                \"explicit date_format instead of relying on inference\"\n            ) from exc\n    raise ValueError(\n        f\"{field_name} must be a date, datetime, or ISO-8601 string, \"\n        f\"got {type(value).__name__}\"\n    )\n\n\n@dataclass(frozen=True)\nclass Entity:\n    \"\"\"A legal entity that issues, manages, or faces an instrument.\n\n    Attributes:\n        entity_id: Stable identifier, e.g. an LEI, a CIK, or a local key.\n        name: Human-readable legal name.\n        entity_type: Role the entity plays; see ``EntityType``.\n        domicile: Country or jurisdiction code, free-form and optional.","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/entities/models.py#L113-L149","documentation":"normalize_date tries ISO-8601 (date and datetime) parsing on strings and, when both fail, raises with the offending value and a hint to pass an explicit date_format instead of relying on inference.","triggerScenarios":"Passing date strings like '2024/03/31', '31-03-2024', or 'Mar 2024' anywhere a date is expected without a date_format.","commonSituations":"Locale-formatted exports (DD/MM/YYYY), slash-separated dates, or month-name formats from spreadsheets.","solutions":["Normalize to ISO: pd.to_datetime(v).date() or datetime.strptime upstream","Pass an explicit date_format where the API supports it (e.g. load_panel(date_format='%d/%m/%Y'))","Convert strings to datetime.date objects before passing"],"exampleFix":"# before\npanel = load_panel('p.csv')  # dates like 31/03/2024\n# after\npanel = load_panel('p.csv', date_format='%d/%m/%Y')","handlingStrategy":"validation","validationCode":"from datetime import datetime\ntry: datetime.fromisoformat(d.strip())\nexcept ValueError: d = datetime.strptime(d.strip(), '%d/%m/%Y').date().isoformat()","typeGuard":null,"tryCatchPattern":"except ValueError as e:\n    if 'not ISO-8601' in str(e): parse with strptime/date_format and retry","preventionTips":["Always pass date_format for non-ISO sources","Normalize dates to ISO at ingestion"],"tags":["date","parsing","iso8601","models"],"backgroundTag":"date-parse-failed","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}