{
  "id": "python/sqlalchemy-exc-invalid-request-relationship-not-loaded",
  "signature": "sqlalchemy.exc.InvalidRequestError: When initializing mapper Mapper[User(users)], expression 'addresses' failed to locate a name",
  "signature_zh": "初始化映射器 Mapper[User(users)] 时，表达式 'addresses' 未能定位到名称",
  "regex": "sqlalchemy\\.exc\\.InvalidRequestError:\\ When\\ initializing\\ mapper\\ Mapper\\[User\\(users\\)\\],\\ expression\\ 'addresses'\\ failed\\ to\\ locate\\ a\\ name",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "A relationship attribute in the ORM model references another class or attribute that is not defined or imported correctly.",
  "root_cause_type": "generic",
  "root_cause_zh": "ORM 模型中的关系属性引用了另一个未正确定义或导入的类或属性。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Renaming the attribute only",
      "why_fails": "",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Deleting the relationship",
      "why_fails": "",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Import target class before usage",
      "success_rate": 0.95,
      "how": "Ensure the referenced class is imported and defined before the model using it, e.g., from models import Address.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use string reference for relationship",
      "success_rate": 0.9,
      "how": "Use string-based relationship targets like 'Address' if the class is defined later in the same module.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}