{"record":{"id":"d71f30f3a577b6fb","repo":"feder-cr/Jobs_Applier_AI_Agent_AIHawk","slug":"error-in-availability-data-e","errorCode":null,"errorMessage":"Error in availability data: {e}","messagePattern":"Error in availability data: (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"src/resume_schemas/job_application_profile.py","lineNumber":146,"sourceCode":"            raise TypeError(f\"Error in work_preferences data: {e}\") from e\n        except AttributeError as e:\n            logger.error(f\"Attribute error in work_preferences processing: {e}\")\n            raise AttributeError(\"Attribute error in work_preferences processing.\") from e\n        except Exception as e:\n            logger.error(f\"An unexpected error occurred while processing work_preferences: {e}\")\n            raise RuntimeError(\"An unexpected error occurred while processing work_preferences.\") from e\n\n        # Process availability\n        try:\n            logger.debug(\"Processing availability\")\n            self.availability = Availability(**data['availability'])\n            logger.debug(f\"Availability processed: {self.availability}\")\n        except KeyError as e:\n            logger.error(f\"Required field {e} is missing in availability data.\")\n            raise KeyError(f\"Required field {e} is missing in availability data.\") from e\n        except TypeError as e:\n            logger.error(f\"Error in availability data: {e}\")\n            raise TypeError(f\"Error in availability data: {e}\") from e\n        except AttributeError as e:\n            logger.error(f\"Attribute error in availability processing: {e}\")\n            raise AttributeError(\"Attribute error in availability processing.\") from e\n        except Exception as e:\n            logger.error(f\"An unexpected error occurred while processing availability: {e}\")\n            raise RuntimeError(\"An unexpected error occurred while processing availability.\") from e\n\n        # Process salary_expectations\n        try:\n            logger.debug(\"Processing salary_expectations\")\n            self.salary_expectations = SalaryExpectations(**data['salary_expectations'])\n            logger.debug(f\"salary_expectations processed: {self.salary_expectations}\")\n        except KeyError as e:\n            logger.error(f\"Required field {e} is missing in salary_expectations data.\")\n            raise KeyError(f\"Required field {e} is missing in salary_expectations data.\") from e\n        except TypeError as e:\n            logger.error(f\"Error in salary_expectations data: {e}\")\n            raise TypeError(f\"Error in salary_expectations data: {e}\") from e","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/feder-cr/Jobs_Applier_AI_Agent_AIHawk/blob/79155b52faccfbd19b834680af285eac70dd2df4/src/resume_schemas/job_application_profile.py#L128-L164","documentation":"TypeError raised while processing availability in JobApplicationProfile.__init__: either data['availability'] is not a dict so **-unpacking fails, or Availability.__init__ got an unexpected keyword argument present in the availability mapping. The original TypeError text in {e} tells you which case it is.","triggerScenarios":"availability given as a string ('immediate') or list in YAML; extra unknown keys inside the availability dict; wrong arity when calling Availability programmatically.","commonSituations":"Human-authored YAML collapsing availability to a scalar; schema drift after Availability gained/lost fields; tool-generated JSON with extra metadata keys inside sections.","solutions":["Ensure data['availability'] is a dict; if the source is a scalar, wrap it appropriately or default to {}.","Prune keys not accepted by Availability.__init__ before unpacking.","Validate resume files against the current schema after upgrading the library."],"exampleFix":"# before\nself.availability = Availability(**data['availability'])  # 'availability: immediate' in YAML\n\n# after\nav = data.get('availability') or {}\nif not isinstance(av, dict):\n    av = {'notice_period': str(av)}\nself.availability = Availability(**av)","handlingStrategy":"type-guard","validationCode":"av = data.get('availability')\nif not isinstance(av, dict):\n    data['availability'] = {}","typeGuard":"def is_availability_dict(data: dict) -> bool:\n    return isinstance(data.get('availability'), dict)","tryCatchPattern":"try:\n    profile = JobApplicationProfile(**data)\nexcept TypeError as e:\n    if 'availability' in str(e):\n        data['availability'] = {}\n        profile = JobApplicationProfile(**data)","preventionTips":["Wrap scalar availability values into dicts at ingest","Disallow lists/scalars for object sections"],"tags":["python","typeerror","dict-unpacking","availability"],"backgroundTag":"schema-validation-failed","analyzedSha":"79155b52faccfbd19b834680af285eac70dd2df4","analyzedAt":"2026-08-28T14:10:26.659Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}