{"record":{"id":"705cb2cddcc26d02","repo":"feder-cr/Jobs_Applier_AI_Agent_AIHawk","slug":"attributeerror-in-education-e","errorCode":null,"errorMessage":"AttributeError in Education: {e}","messagePattern":"AttributeError in Education: (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"src/resume_schemas/resume.py","lineNumber":155,"sourceCode":"        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(\n                    position=exp['position'],\n                    company=exp['company'],\n                    employment_period=exp['employment_period'],\n                    location=exp['location'],","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/feder-cr/Jobs_Applier_AI_Agent_AIHawk/blob/79155b52faccfbd19b834680af285eac70dd2df4/src/resume_schemas/resume.py#L137-L173","documentation":"An AttributeError escaped while processing one education entry — usually because `edu` is not a dict (e.g. a string or None from malformed JSON) so edu.get(...) fails, or a nested value expected to be an object is a scalar. The chained original exception names the attribute.","triggerScenarios":"data containing education entries that are strings/None: for edu in ['BSc Computer Science', None] → 'str' object has no attribute 'get'.","commonSituations":"Heterogeneous extraction output where some entries are plain text instead of structured dicts; null entries in sparse resumes.","solutions":["Read e.__cause__ to identify the offending object type.","Filter/normalize the list first: entries = [e for e in data if isinstance(e, dict)].","Wrap per-entry handling so one bad entry doesn't abort the whole resume (skip-and-log instead of raise)."],"exampleFix":"// before\nfor edu in data:\n    exams = [Exam(name=k, grade=v) for k, v in edu.get('exam', {}).items()]\n\n# after\nfor edu in data:\n    if not isinstance(edu, dict):\n        logger.warning('skipping non-dict education entry: %r', edu)\n        continue\n    ...","handlingStrategy":"type-guard","validationCode":"data = [e for e in data if isinstance(e, dict)]\n# optionally log dropped entries","typeGuard":"def all_dicts(seq: Any) -> TypeGuard[list[dict]]:\n    return isinstance(seq, list) and all(isinstance(e, dict) for e in seq)","tryCatchPattern":"try:\n    edu_list = _process_education_details(data)\nexcept AttributeError as e:\n    logger.warning(\"malformed education entry (%s); skipping\", e)\n    edu_list = [ ]  # or partial results","preventionTips":["Filter non-dict entries out of extracted lists before processing","Skip-and-log instead of failing the whole resume","Check nested value types before attribute access"],"tags":["attributeerror","dataclass","python"],"backgroundTag":"attributeerror-on-dict-construction","analyzedSha":"79155b52faccfbd19b834680af285eac70dd2df4","analyzedAt":"2026-08-28T14:10:26.659Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}