{"record":{"id":"02519255ea4c52da","repo":"pola-rs/polars","slug":"n-rows-cannot-be-used-with-use-pyarrow-true-an","errorCode":null,"errorMessage":"`n_rows` cannot be used with `use_pyarrow=True` and `memory_map=False`","messagePattern":"`n_rows` cannot be used with `use_pyarrow=True` and `memory_map=False`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/ipc/functions.py","lineNumber":162,"sourceCode":"            storage_options=storage_options,\n            row_index_name=row_index_name,\n            row_index_offset=row_index_offset,\n            rechunk=rechunk,\n        )\n\n        if columns:\n            if isinstance(columns[0], int):\n                lf = lf.select(F.nth(columns))  # type: ignore[arg-type]\n            else:\n                lf = lf.select(columns)\n\n        df = lf._collect_eager()\n\n        return df\n\n    if use_pyarrow and n_rows and not memory_map:\n        msg = \"`n_rows` cannot be used with `use_pyarrow=True` and `memory_map=False`\"\n        raise ValueError(msg)\n\n    with prepare_file_arg(\n        source, use_pyarrow=use_pyarrow, storage_options=storage_options\n    ) as data:\n        if use_pyarrow:\n            pyarrow_ipc = import_optional(\n                \"pyarrow.ipc\",\n                err_prefix=\"\",\n                err_suffix=\"is required when using 'read_ipc(..., use_pyarrow=True)'\",\n            )\n\n            if columns is not None and is_non_empty_sequence_of(columns, str):\n                initial_pos: Any = None\n\n                if hasattr(data, \"tell\") and callable(data.tell):\n                    initial_pos = data.tell()\n\n                with pyarrow_ipc.open_file(data) as ipc_f:","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/io/ipc/functions.py#L144-L180","documentation":"Error \"`n_rows` cannot be used with `use_pyarrow=True` and `memory_map=False`\" thrown in pola-rs/polars.","triggerScenarios":"Thrown at py-polars/src/polars/io/ipc/functions.py:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}