{"record":{"id":"2014981acfbeff16","repo":"tensorflow/models","slug":"context-must-be-a-mapping","errorCode":null,"errorMessage":"{context} must be a mapping.","messagePattern":"(.+?) must be a mapping\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py","lineNumber":534,"sourceCode":"\ndef _validate_detection(\n    raw_detection: Any, prompt_name: str\n) -> DetectionConfig:\n  \"\"\"Validates one prompt's detection block into a DetectionConfig.\n\n  Args:\n      raw_detection: The ``detection`` mapping read from YAML.\n      prompt_name: Prompt name used in error messages.\n\n  Returns:\n      A validated :class:`DetectionConfig`.\n\n  Raises:\n      ConfigError: If any field is missing or out of range.\n  \"\"\"\n  context = f\"prompts.{prompt_name!r}.detection\"\n  if not isinstance(raw_detection, dict):\n    raise ConfigError(f\"{context} must be a mapping.\")\n  _require_keys(raw_detection, _REQUIRED_DETECTION_KEYS, context)\n\n  confidence_threshold = _require_number_in_range(\n      raw_detection[\"confidence_threshold\"],\n      f\"{context}.confidence_threshold\",\n      0.0,\n      1.0,\n  )\n  score_threshold = _require_number_in_range(\n      raw_detection[\"score_threshold\"],\n      f\"{context}.score_threshold\",\n      0.0,\n      1.0,\n  )\n  containment_threshold = _require_number_in_range(\n      raw_detection[\"containment_threshold\"],\n      f\"{context}.containment_threshold\",\n      0.0,","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py#L516-L552","documentation":"Error \"{context} must be a mapping.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:534 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}