{"record":{"id":"9e1f21c150838140","repo":"agentscope-ai/agentscope","slug":"the-table-format-must-be-one-of-markdown-or-jso","errorCode":null,"errorMessage":"The table_format must be one of 'markdown' or 'json', got {table_format!r}.","messagePattern":"The table_format must be one of 'markdown' or 'json', got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/agentscope/rag/_parser/_excel.py","lineNumber":202,"sourceCode":"            include_cell_coordinates (`bool`, defaults to ``False``):\n                Whether to include cell coordinates (e.g. ``[A1]``) in\n                the rendered table.\n            include_image (`bool`, defaults to ``False``):\n                Whether to extract and include embedded images.\n                Requires ``openpyxl``.\n            separate_sheet (`bool`, defaults to ``False``):\n                If ``True``, images and table text from different\n                sheets are never combined into the same section.\n            table_format (`Literal[\"markdown\", \"json\"]``, defaults to\n                ``\"markdown\"``):\n                How to render tables.\n\n        Raises:\n            `ValueError`: If ``table_format`` is not ``\"markdown\"``\n                or ``\"json\"``.\n        \"\"\"\n        if table_format not in (\"markdown\", \"json\"):\n            raise ValueError(\n                \"The table_format must be one of 'markdown' or 'json', \"\n                f\"got {table_format!r}.\",\n            )\n        self.include_sheet_names = include_sheet_names\n        self.include_cell_coordinates = include_cell_coordinates\n        self.include_image = include_image\n        self.separate_sheet = separate_sheet\n        self.table_format = table_format\n\n    async def parse(\n        self,\n        file: bytes | str,\n        filename: str,\n    ) -> list[Section]:\n        \"\"\"Parse an Excel file into a list of :class:`Section` objects.\n\n        Args:\n            file (`bytes | str`):","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/rag/_parser/_excel.py#L184-L220","documentation":"ExcelParser only accepts table_format of 'markdown' or 'json'; any other value is rejected in __init__ with a ValueError showing the invalid value.","triggerScenarios":"Constructing ExcelParser(table_format='csv') or 'md'/'Markdown' (case-sensitive) or 'html'.","commonSituations":"Passing 'md' as an abbreviation; case mismatch from config files; copying format strings from a different parser/library.","solutions":["Use exactly 'markdown' or 'json' (lowercase)","Normalize config input: fmt = fmt.lower() and map 'md'->'markdown' before constructing"],"exampleFix":"# before\nparser = ExcelParser(table_format='md')\n\n# after\nparser = ExcelParser(table_format='markdown')","handlingStrategy":"validation","validationCode":"table_format = {'md': 'markdown'}.get(table_format, table_format)\nassert table_format in ('markdown', 'json')","typeGuard":"def is_table_format(v: str) -> bool:\n    return v in ('markdown', 'json')","tryCatchPattern":null,"preventionTips":["Use a Literal['markdown','json'] type in your config models","Normalize abbreviations at config load"],"tags":["agentscope","rag","excel","parser","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}