{
  "id": "python/sqlalchemy-unhashable-condition",
  "signature": "sqlalchemy.exc.InvalidRequestError: Could not evaluate current criteria in Python. Specify 'fetch' or False for the synchronize_session parameter.",
  "signature_zh": "无法在 Python 中评估当前条件。请为 synchronize_session 参数指定 'fetch' 或 False。",
  "regex": "sqlalchemy\\.exc\\.InvalidRequestError:\\ Could\\ not\\ evaluate\\ current\\ criteria\\ in\\ Python\\.\\ Specify\\ 'fetch'\\ or\\ False\\ for\\ the\\ synchronize_session\\ parameter\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Using a bulk update/delete with a complex expression that SQLAlchemy cannot evaluate in the session, especially with certain database-specific functions.",
  "root_cause_type": "generic",
  "root_cause_zh": "在批量更新/删除中使用复杂表达式，SQLAlchemy 无法在会话中评估，尤其使用特定数据库函数时。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Default is 'auto' which may still fail for complex criteria.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May bypass ORM features but not always desired.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "session.query(User).filter(User.age > 30).update({'active': False}, synchronize_session=False)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "session.query(User).filter(User.age > 30).update({'active': False}, synchronize_session='fetch')",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}