{"record":{"id":"5344556842c80048","repo":"pola-rs/polars","slug":"a-more-recent-version-of-fastexcel-is-required-f-534455","errorCode":null,"errorMessage":"a more recent version of `fastexcel` is required for 'table_name' (>= 0.12.0; found {original_version})","messagePattern":"a more recent version of `fastexcel` is required for 'table_name' \\(>= 0\\.12\\.0; found (.+?)\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/spreadsheet/functions.py","lineNumber":1057,"sourceCode":"    table_name: str | None = None,\n    drop_empty_rows: bool,\n    drop_empty_cols: bool,\n    raise_if_empty: bool,\n) -> pl.DataFrame:\n    # if we have 'schema_overrides' and a more recent version of `fastexcel`\n    # we can pass translated dtypes to the engine to refine the initial parse\n    fastexcel = import_optional(\"fastexcel\")\n    fastexcel_version = parse_version(original_version := fastexcel.__version__)\n\n    if fastexcel_version < (0, 9) and \"schema_sample_rows\" in read_options:\n        msg = f\"a more recent version of `fastexcel` is required for 'schema_sample_rows' (>= 0.9; found {original_version})\"\n        raise ModuleUpgradeRequiredError(msg)\n    if fastexcel_version < (0, 10, 2) and \"use_columns\" in read_options:\n        msg = f\"a more recent version of `fastexcel` is required for 'use_columns' (>= 0.10.2; found {original_version})\"\n        raise ModuleUpgradeRequiredError(msg)\n    if table_name and fastexcel_version < (0, 12):\n        msg = f\"a more recent version of `fastexcel` is required for 'table_name' (>= 0.12.0; found {original_version})\"\n        raise ValueError(msg)\n\n    if columns:\n        if not isinstance(columns, list):\n            columns = list(columns)  # type: ignore[assignment]\n        read_options[\"use_columns\"] = columns\n\n    schema_overrides = schema_overrides or {}\n    if read_options.get(\"schema_sample_rows\") == 0:\n        # ref: https://github.com/ToucanToco/fastexcel/issues/236\n        del read_options[\"schema_sample_rows\"]\n        read_options[\"dtypes\"] = (\n            \"string\"\n            if fastexcel_version >= (0, 12, 1)\n            else dict.fromkeys(range(16384), \"string\")\n        )\n    elif schema_overrides and fastexcel_version >= (0, 10):\n        parser_dtypes = read_options.get(\"dtypes\", {})\n        for name, dtype in schema_overrides.items():","sourceCodeStart":1039,"sourceCodeEnd":1075,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/spreadsheet/functions.py#L1039-L1075","documentation":"Reading a named Excel table via the calamine engine requires fastexcel >= 0.12, which introduced `load_table`. When `table_name` is supplied and the installed fastexcel is older, polars raises ValueError stating the required minimum version and the found version.","triggerScenarios":"`pl.read_excel('f.xlsx', engine='calamine', table_name='Table1')` with fastexcel < 0.12 installed.","commonSituations":"Attempting to read Excel named tables with an old fastexcel; stale requirements; upgrading polars (which added table support) without upgrading fastexcel.","solutions":["Upgrade fastexcel: pip install -U 'fastexcel>=0.12'.","Pin fastexcel>=0.12 where named-table reading is used.","Fall back to reading the sheet and filtering rows to the table range manually if upgrade is not possible."],"exampleFix":"// before\n# fastexcel 0.10 installed\npl.read_excel('f.xlsx', engine='calamine', table_name='SalesTable')\n// after\n# pip install -U 'fastexcel>=0.12'\npl.read_excel('f.xlsx', engine='calamine', table_name='SalesTable')","handlingStrategy":"validation","validationCode":"from importlib.metadata import version\nfrom packaging.version import Version\nif table_name and Version(version('fastexcel')) < Version('0.12'):\n    raise RuntimeError('fastexcel>=0.12 required for table_name')","typeGuard":null,"tryCatchPattern":"try:\n    df = pl.read_excel(path, engine='calamine', table_name=table_name)\nexcept (ValueError, ModuleUpgradeRequiredError) as e:\n    log.warning('Named-table read unavailable: %s', e)\n    df = pl.read_excel(path, engine='calamine', sheet_name=sheet_name)","preventionTips":["Pin 'fastexcel>=0.12' if reading named tables","Upgrade fastexcel when adopting newer polars features","Fall back to sheet reads when table support is unavailable"],"tags":["polars","fastexcel","dependency-version"],"backgroundTag":"missing-dependency","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}