{"record":{"id":"4dd479b2d36db30c","repo":"deepset-ai/haystack","slug":"unsupported-export-format-table-format-choose","errorCode":null,"errorMessage":"Unsupported export format: {table_format}. Choose either 'csv' or 'markdown'.","messagePattern":"Unsupported export format: (.+?)\\. Choose either 'csv' or 'markdown'\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"haystack/components/converters/xlsx.py","lineNumber":83,"sourceCode":"        :param read_excel_kwargs: Additional arguments to pass to `pandas.read_excel`.\n            See https://pandas.pydata.org/docs/reference/api/pandas.read_excel.html#pandas-read-excel\n        :param table_format_kwargs: Additional keyword arguments to pass to the table format function.\n            - If `table_format` is \"csv\", these arguments are passed to `pandas.DataFrame.to_csv`.\n              See https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html#pandas-dataframe-to-csv\n            - If `table_format` is \"markdown\", these arguments are passed to `pandas.DataFrame.to_markdown`.\n              See https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_markdown.html#pandas-dataframe-to-markdown\n        :param link_format: The format for link output. Possible options:\n            - `\"markdown\"`: `[text](url)`\n            - `\"plain\"`: `text (url)`\n            - `\"none\"`: Only the text is extracted, link addresses are ignored.\n        :param store_full_path:\n            If True, the full path of the file is stored in the metadata of the document.\n            If False, only the file name is stored.\n        \"\"\"\n        pandas_xlsx_import.check()\n        self.table_format = table_format\n        if table_format not in [\"csv\", \"markdown\"]:\n            raise ValueError(f\"Unsupported export format: {table_format}. Choose either 'csv' or 'markdown'.\")\n        if link_format not in (\"markdown\", \"plain\", \"none\"):\n            msg = f\"Unknown link format '{link_format}'. Supported formats are: 'markdown', 'plain', 'none'\"\n            raise ValueError(msg)\n        if table_format == \"markdown\":\n            tabulate_import.check()\n        self.link_format = link_format\n        self.sheet_name = sheet_name\n        self.read_excel_kwargs = read_excel_kwargs or {}\n        self.table_format_kwargs = table_format_kwargs or {}\n        self.store_full_path = store_full_path\n\n    @component.output_types(documents=list[Document])\n    def run(\n        self, sources: list[str | Path | ByteStream], meta: dict[str, Any] | list[dict[str, Any]] | None = None\n    ) -> dict[str, list[Document]]:\n        \"\"\"\n        Converts a XLSX file to a Document.\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/converters/xlsx.py#L65-L101","documentation":"XLSXToDocument's __init__ validates the table_format option: only 'csv' or 'markdown' are supported for exporting tables inside the spreadsheet. Any other value raises ValueError at construction time, before any file is read.","triggerScenarios":"Instantiating XLSXToDocument(table_format=...) with a value other than 'csv' or 'markdown', e.g. 'excel', 'json', 'html', or 'Markdown' (case-sensitive).","commonSituations":"Typo or wrong casing in pipeline YAML; expecting other pandas to_* output formats; copying a table_format value from a different converter component.","solutions":["Set table_format='markdown' (rich table rendering; requires tabulate) or table_format='csv'.","Match casing exactly — the check is case-sensitive.","If you need another format, post-process the Documents yourself instead of via table_format."],"exampleFix":"# before\nconverter = XLSXToDocument(table_format=\"json\")\n# after\nconverter = XLSXToDocument(table_format=\"markdown\")","handlingStrategy":"validation","validationCode":"VALID_TABLE_FORMATS = (\"csv\", \"markdown\")\n\ndef is_valid_table_format(fmt: str) -> bool:\n    return fmt in VALID_TABLE_FORMATS\n\nassert is_valid_table_format(table_format), f\"{table_format!r} not in {VALID_TABLE_FORMATS}\"","typeGuard":"from typing import Literal\nTableFormat = Literal[\"csv\", \"markdown\"]\n\ndef is_table_format(s: str) -> bool:\n    return s in (\"csv\", \"markdown\")","tryCatchPattern":"try:\n    converter = XLSXToDocument(table_format=fmt)\nexcept ValueError as e:\n    logger.warning(\"Invalid table_format %s, defaulting to markdown\", e)\n    converter = XLSXToDocument(table_format=\"markdown\")","preventionTips":["Use the Literal[\"csv\", \"markdown\"] annotation for config values loaded from YAML","Remember the check is case-sensitive — normalize/validate casing at config load","If you need other export formats, post-process Documents instead of extending table_format"],"tags":["python","valueerror","xlsx","invalid-argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}