{"record":{"id":"ee21dd89e8bdc9ff","repo":"pola-rs/polars","slug":"can-not-set-ascii-tables-and-tbl-formatting-at","errorCode":null,"errorMessage":"Can not set `ascii_tables` and `tbl_formatting` at the same time.","messagePattern":"Can not set `ascii_tables` and `tbl_formatting` at the same time\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/dataframe/frame.py","lineNumber":13212,"sourceCode":"        │ i64 ┆ i64 ┆ str │\n        ╞═════╪═════╪═════╡\n        │ 1   ┆ 6   ┆ a   │\n        │ 2   ┆ 7   ┆ b   │\n        └─────┴─────┴─────┘\n        \"\"\"\n        if limit is None:\n            df = self\n            tbl_rows = -1\n        else:\n            df = self.head(limit)\n            if limit < 0:\n                tbl_rows = self.height - abs(limit)\n            else:\n                tbl_rows = limit\n\n        if ascii_tables is not None and tbl_formatting is not None:\n            msg = \"Can not set `ascii_tables` and `tbl_formatting` at the same time.\"\n            raise ValueError(msg)\n        if ascii_tables is not None:\n            if ascii_tables:\n                tbl_formatting = \"ASCII_FULL_CONDENSED\"\n            else:\n                tbl_formatting = \"UTF8_FULL_CONDENSED\"\n\n        with Config(\n            ascii_tables=ascii_tables,\n            decimal_separator=decimal_separator,\n            thousands_separator=thousands_separator,\n            float_precision=float_precision,\n            fmt_float=fmt_float,\n            fmt_str_lengths=fmt_str_lengths,\n            fmt_table_cell_list_len=fmt_table_cell_list_len,\n            tbl_cell_alignment=tbl_cell_alignment,\n            tbl_cell_numeric_alignment=tbl_cell_numeric_alignment,\n            tbl_cols=tbl_cols,\n            tbl_column_data_type_inline=tbl_column_data_type_inline,","sourceCodeStart":13194,"sourceCodeEnd":13230,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/dataframe/frame.py#L13194-L13230","documentation":"DataFrame.show renders the frame with configurable table styling. ascii_tables is a convenience boolean that expands to tbl_formatting='ASCII_FULL_CONDENSED' (True) or 'UTF8_FULL_CONDENSED' (False); since both settings write the same underlying style, passing ascii_tables together with an explicit tbl_formatting is ambiguous and rejected with this ValueError.","triggerScenarios":"df.show(10, ascii_tables=True, tbl_formatting='ASCII_MARKDOWN'); splatting a shared options dict into show(**opts) where both keys are present; copying a full option set from other table-config APIs into show.","commonSituations":"Config-driven rendering where merged defaults from multiple sources leave both keys set; README/wiki snippets that combine the convenience flag with a named style; upgrading code that previously used only one of the two.","solutions":["Drop ascii_tables and express the style directly: tbl_formatting='ASCII_FULL_CONDENSED' reproduces ascii_tables=True","Or drop tbl_formatting and keep ascii_tables if only the ascii/utf8 toggle matters","When splatting option dicts, remove the conflicting key first: opts.pop('ascii_tables', None)"],"exampleFix":"# before\ndf.show(10, ascii_tables=True, tbl_formatting='ASCII_MARKDOWN')\n\n# after\ndf.show(10, tbl_formatting='ASCII_MARKDOWN')","handlingStrategy":"validation","validationCode":"if 'ascii_tables' in opts and 'tbl_formatting' in opts:\n    del opts['ascii_tables']  # prefer the explicit named style\nout = df.show(limit, **opts)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one styling channel per call: the ascii_tables toggle or a named tbl_formatting style","When splatting merged option dicts into show(), pop one of the conflicting keys first","Encode the equivalence ASCII_FULL_CONDENSED <-> ascii_tables=True in your config docs"],"tags":["polars","dataframe","show","display-options","flag-conflict","valueerror"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}