{"record":{"id":"1812d58c601e49a6","repo":"pola-rs/polars","slug":"limit-cannot-be-none-if-you-want-to-show-the-co","errorCode":null,"errorMessage":"`limit` cannot be None. If you want to show the complete lazyframe, call `.collect().show()` on it.","messagePattern":"`limit` cannot be None\\. If you want to show the complete lazyframe, call `\\.collect\\(\\)\\.show\\(\\)` on it\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"py-polars/src/polars/lazyframe/frame.py","lineNumber":9972,"sourceCode":"        │ 2   ┆ 8   │\n        │ 3   ┆ 9   │\n        │ 4   ┆ 10  │\n        │ 5   ┆ 11  │\n        └─────┴─────┘\n        >>> lf.show(2)\n        shape: (2, 2)\n        ┌─────┬─────┐\n        │ a   ┆ b   │\n        │ --- ┆ --- │\n        │ i64 ┆ i64 │\n        ╞═════╪═════╡\n        │ 1   ┆ 7   │\n        │ 2   ┆ 8   │\n        └─────┴─────┘\n        \"\"\"\n        if limit is None:\n            msg = \"`limit` cannot be None. If you want to show the complete lazyframe, call `.collect().show()` on it.\"\n            raise ValueError(msg)\n\n        self.head(limit).collect(engine=\"streaming\").show(\n            limit,\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,\n            tbl_dataframe_shape_below=tbl_dataframe_shape_below,\n            tbl_formatting=tbl_formatting,\n            tbl_hide_column_data_types=tbl_hide_column_data_types,\n            tbl_hide_column_names=tbl_hide_column_names,","sourceCodeStart":9954,"sourceCodeEnd":9990,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/lazyframe/frame.py#L9954-L9990","documentation":"LazyFrame.show renders a bounded preview; a lazyframe is not materialized, so limit=None (which in DataFrame.show means 'show everything') is rejected with a ValueError that redirects you to .collect().show() for the full table.","triggerScenarios":"lf.show(None); passing limit=None programmatically in helpers shared between pl.DataFrame and pl.LazyFrame; copying eager-frame show(None) habits to lazy frames.","commonSituations":"Code reused across eager/lazy frames; users expecting DataFrame.show semantics; attempting to dump an entire (possibly unbounded) lazy result.","solutions":["Call lf.collect().show() to materialize and display the full table","Or pass an explicit integer bound: lf.show(100)","In shared helpers, branch: if isinstance(frame, pl.LazyFrame) and limit is None: frame = frame.collect()"],"exampleFix":"// before\nlf.show(None)\n\n// after\nlf.collect().show()  # full table\nlf.show(100)         # or a bounded lazy preview","handlingStrategy":"validation","validationCode":"if isinstance(frame, pl.LazyFrame):\n    if limit is None:\n        frame = frame.collect()   # then show(None) is fine\nframe.show(limit)","typeGuard":"def lazy_show_safe(frame, limit=None):\n    if isinstance(frame, pl.LazyFrame) and limit is None:\n        return frame.collect().show()\n    return frame.show(limit)","tryCatchPattern":null,"preventionTips":["A lazyframe may be unbounded; always bound lazy previews with an int","Reserve show(None) for eager frames"],"tags":["polars","lazyframe","display","usage-error"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}