{"record":{"id":"5f5942f4258f8320","repo":"ZhuLinsen/daily_stock_analysis","slug":"validation-error-5f5942","errorCode":"validation_error","errorMessage":"broker must be one of: {supported}","messagePattern":"broker must be one of: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"src/services/portfolio_import_service.py","lineNumber":277,"sourceCode":"                failed_count += 1\n                errors.append(f\"idx={i}: {exc}\")\n\n        return {\n            \"account_id\": account_id,\n            \"record_count\": len(records),\n            \"inserted_count\": inserted_count,\n            \"duplicate_count\": duplicate_count,\n            \"failed_count\": failed_count,\n            \"dry_run\": bool(dry_run),\n            \"errors\": errors[:20],\n        }\n\n    def _normalize_broker(self, value: str) -> str:\n        broker = (value or \"\").strip().lower()\n        broker = self._broker_alias_map.get(broker, broker)\n        if broker not in self._parser_registry:\n            supported = \", \".join(sorted(self._parser_registry.keys()))\n            raise ValueError(f\"broker must be one of: {supported}\")\n        return broker\n\n    @staticmethod\n    def _read_csv(content: bytes) -> pd.DataFrame:\n        for encoding in (\"utf-8-sig\", \"gbk\", \"gb18030\"):\n            try:\n                return pd.read_csv(\n                    io.BytesIO(content),\n                    encoding=encoding,\n                    dtype=str,\n                    keep_default_na=False,\n                )\n            except UnicodeDecodeError:\n                continue\n        return pd.read_csv(io.BytesIO(content), dtype=str, keep_default_na=False)\n\n    def _normalize_trade_row(\n        self,","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/ZhuLinsen/daily_stock_analysis/blob/5159bd72e8373d215492dff122acc9d389e219c9/src/services/portfolio_import_service.py#L259-L295","documentation":"Error \"broker must be one of: {supported}\" thrown in ZhuLinsen/daily_stock_analysis.","triggerScenarios":"Thrown at src/services/portfolio_import_service.py:277 when the library encounters an invalid state.","commonSituations":"Raised when importing a portfolio for an unsupported broker; occurs when the broker parameter is not one of the supported import adapters.","solutions":["Use one of the supported broker identifiers listed in the error.","Check the import request/config for a typo in the broker name.","If the broker should be supported, add its adapter to the import service first."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5159bd72e8373d215492dff122acc9d389e219c9","analyzedAt":"2026-08-15T01:59:36.292Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}