feder-cr/Jobs_Applier_AI_Agent_AIHawk · error · TypeError
Error in availability data: {e}
Error message
Error in availability data: {e} What it means
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.
Source
Thrown at src/resume_schemas/job_application_profile.py:146
raise TypeError(f"Error in work_preferences data: {e}") from e
except AttributeError as e:
logger.error(f"Attribute error in work_preferences processing: {e}")
raise AttributeError("Attribute error in work_preferences processing.") from e
except Exception as e:
logger.error(f"An unexpected error occurred while processing work_preferences: {e}")
raise RuntimeError("An unexpected error occurred while processing work_preferences.") from e
# Process availability
try:
logger.debug("Processing availability")
self.availability = Availability(**data['availability'])
logger.debug(f"Availability processed: {self.availability}")
except KeyError as e:
logger.error(f"Required field {e} is missing in availability data.")
raise KeyError(f"Required field {e} is missing in availability data.") from e
except TypeError as e:
logger.error(f"Error in availability data: {e}")
raise TypeError(f"Error in availability data: {e}") from e
except AttributeError as e:
logger.error(f"Attribute error in availability processing: {e}")
raise AttributeError("Attribute error in availability processing.") from e
except Exception as e:
logger.error(f"An unexpected error occurred while processing availability: {e}")
raise RuntimeError("An unexpected error occurred while processing availability.") from e
# Process salary_expectations
try:
logger.debug("Processing salary_expectations")
self.salary_expectations = SalaryExpectations(**data['salary_expectations'])
logger.debug(f"salary_expectations processed: {self.salary_expectations}")
except KeyError as e:
logger.error(f"Required field {e} is missing in salary_expectations data.")
raise KeyError(f"Required field {e} is missing in salary_expectations data.") from e
except TypeError as e:
logger.error(f"Error in salary_expectations data: {e}")
raise TypeError(f"Error in salary_expectations data: {e}") from eView on GitHub (pinned to 79155b52fa)
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.
Example fix
# before
self.availability = Availability(**data['availability']) # 'availability: immediate' in YAML
# after
av = data.get('availability') or {}
if not isinstance(av, dict):
av = {'notice_period': str(av)}
self.availability = Availability(**av) Defensive patterns
Strategy: type-guard
Validate before calling
av = data.get('availability')
if not isinstance(av, dict):
data['availability'] = {} Type guard
def is_availability_dict(data: dict) -> bool:
return isinstance(data.get('availability'), dict) Try / catch
try:
profile = JobApplicationProfile(**data)
except TypeError as e:
if 'availability' in str(e):
data['availability'] = {}
profile = JobApplicationProfile(**data) Prevention
- Wrap scalar availability values into dicts at ingest
- Disallow lists/scalars for object sections
When it happens
Trigger: availability given as a string ('immediate') or list in YAML; extra unknown keys inside the availability dict; wrong arity when calling Availability programmatically.
Common situations: Human-authored YAML collapsing availability to a scalar; schema drift after Availability gained/lost fields; tool-generated JSON with extra metadata keys inside sections.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Error in legal_authorization data: {e}
- Error in work_preferences data: {e}
- Error in salary_expectations data: {e}
- Required field {e} is missing in availability data.
- Attribute error in availability processing.
AI-assisted analysis of feder-cr/Jobs_Applier_AI_Agent_AIHawk@79155b52fa (2026-08-28).
Data as JSON: /api/errors/d71f30f3a577b6fb.
Report an issue: GitHub.