(input_dir: Path)
| 178 | |
| 179 | |
| 180 | def load_user_metadata(input_dir: Path) -> Dict[str, Dict[str, Any]]: |
| 181 | payload = load_json(input_dir / "users.json") |
| 182 | users = payload.get("users") if isinstance(payload, dict) else [] |
| 183 | metadata: Dict[str, Dict[str, Any]] = {} |
| 184 | if isinstance(users, list): |
| 185 | for item in users: |
| 186 | if not isinstance(item, dict): |
| 187 | continue |
| 188 | user_id = str(item.get("user_id") or "").strip() |
| 189 | if user_id: |
| 190 | metadata[user_id] = item |
| 191 | return metadata |
| 192 | |
| 193 | |
| 194 | def build_query_profile(user_meta: Dict[str, Any], role: Dict[str, Any]) -> Dict[str, Any]: |
no test coverage detected