{"record":{"id":"f29682224529ccf7","repo":"feder-cr/Jobs_Applier_AI_Agent_AIHawk","slug":"missing-field-in-education-details-e","errorCode":null,"errorMessage":"Missing field in education details: {e}","messagePattern":"Missing field in education details: (.+?)","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"src/resume_schemas/resume.py","lineNumber":151,"sourceCode":"            raise Exception(f\"Unexpected error in PersonalInformation processing: {e}\") from e\n\n    def _process_education_details(self, data: List[Dict[str, Any]]) -> List[EducationDetails]:\n        education_list = []\n        for edu in data:\n            try:\n                exams = [Exam(name=k, grade=v) for k, v in edu.get('exam', {}).items()]\n                education = EducationDetails(\n                    education_level=edu.get('education_level'),\n                    institution=edu.get('institution'),\n                    field_of_study=edu.get('field_of_study'),\n                    final_evaluation_grade=edu.get('final_evaluation_grade'),\n                    start_date=edu.get('start_date'),\n                    year_of_completion=edu.get('year_of_completion'),\n                    exam=exams\n                )\n                education_list.append(education)\n            except KeyError as e:\n                raise KeyError(f\"Missing field in education details: {e}\") from e\n            except TypeError as e:\n                raise TypeError(f\"Invalid data for Education: {e}\") from e\n            except AttributeError as e:\n                raise AttributeError(f\"AttributeError in Education: {e}\") from e\n            except Exception as e:\n                raise Exception(f\"Unexpected error in Education processing: {e}\") from e\n        return education_list\n\n    def _process_experience_details(self, data: List[Dict[str, Any]]) -> List[ExperienceDetails]:\n        experience_list = []\n        for exp in data:\n            try:\n                key_responsibilities = [\n                    Responsibility(description=list(resp.values())[0])\n                    for resp in exp.get('key_responsibilities', [])\n                ]\n                skills_acquired = [str(skill) for skill in exp.get('skills_acquired', [])]\n                experience = ExperienceDetails(","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/feder-cr/Jobs_Applier_AI_Agent_AIHawk/blob/79155b52faccfbd19b834680af285eac70dd2df4/src/resume_schemas/resume.py#L133-L169","documentation":"Raised when building an EducationDetails entry and a required key is accessed with exp-style subscripting (edu['field'] or similar) on a dict that lacks it. The original KeyError names the exact missing key in the chained message. It means the education entry in the input list is incomplete relative to what the constructor path requires.","triggerScenarios":"An element of the education list lacks a required key such as 'school' or 'degree' — the exam parsing uses .get() but required fields use direct indexing somewhere in the EducationDetails construction path.","commonSituations":"Partial education data from OCR/LLM extraction; optional semesters where one entry only has exam grades; schema where start_date/year_of_completion are optional via .get() but other fields are not.","solutions":["Read the chained KeyError to get the missing key name; either supply it in the data or switch that access to edu.get('key') with a sensible default.","Pre-validate each education dict: required = {'school', ...}; missing = required - edu.keys().","If the field is genuinely optional, give the dataclass field a default (e.g. Optional[str] = None)."],"exampleFix":"// before\neducation = EducationDetails(school=edu['school'], ...)\n\n# after\neducation = EducationDetails(school=edu.get('school'), ...)  # if optional","handlingStrategy":"validation","validationCode":"REQUIRED_EDU = {'school'}  # adjust to the keys your pipeline indexes directly\n\ndef validate_education_entry(edu: dict):\n    if not isinstance(edu, dict):\n        raise ValueError(f\"education entry must be dict, got {type(edu).__name__}\")\n    missing = REQUIRED_EDU - edu.keys()\n    if missing:\n        raise ValueError(f\"education entry missing: {sorted(missing)}\")","typeGuard":"def is_education_entry(x: Any) -> TypeGuard[dict]:\n    return isinstance(x, dict)","tryCatchPattern":"try:\n    edu_list = _process_education_details(data)\nexcept KeyError as e:\n    logger.warning(\"education entry missing %s; skipping section\", e.args[0])\n    edu_list = []","preventionTips":["Use .get() with defaults for optional resume fields","Validate required keys per entry before processing","Default education fields to None in the dataclass"],"tags":["keyerror","dataclass","schema-validation","python"],"backgroundTag":"missing-dict-key","analyzedSha":"79155b52faccfbd19b834680af285eac70dd2df4","analyzedAt":"2026-08-28T14:10:26.659Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}