{"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":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/frame.py","lineNumber":9590,"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":9572,"sourceCodeEnd":9608,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/lazyframe/frame.py#L9572-L9608","documentation":"LazyFrame.show() requires an explicit `limit` because a LazyFrame has no known size; showing everything would force a full unbounded collect. Polars refuses `limit=None` and tells you to collect first if you truly want the complete frame.","triggerScenarios":"Calling LazyFrame.show() with limit=None, e.g. lf.show() where limit was computed as None or explicitly passed as None.","commonSituations":"Refactoring from DataFrame.show() (where limit=None is allowed) to LazyFrame.show(); passing a configurable limit variable that defaults to None.","solutions":["Pass an explicit integer limit, e.g. lf.show(10)","If you want the full frame displayed, call lf.collect().show() instead","Default your limit variable to a number (e.g. 10) rather than None"],"exampleFix":"// before\nlf.show(limit=None)\n// after\nlf.show(10)  # or lf.collect().show() for the full frame","handlingStrategy":"validation","validationCode":"if limit is None:\n    raise ValueError(\"pass an explicit limit to LazyFrame.show()\")\nlf.show(limit)","typeGuard":null,"tryCatchPattern":"try:\n    lf.show(limit)\nexcept ValueError as e:\n    lf.collect().show()","preventionTips":["Never pass None as limit to LazyFrame.show()","Default limit variables to a concrete integer","Remember LazyFrame.show() always samples; use collect().show() for full output"],"tags":["python","polars","lazyframe","argument-validation"],"backgroundTag":"null-argument","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"}