{"record":{"id":"4576cacb1bab69d7","repo":"pola-rs/polars","slug":"unsupported-parameter-parameter-has-no-effect","errorCode":null,"errorMessage":"`{unsupported_parameter}` parameter has no effect when using `from_arrow(<ArrowStreamExportable>)`","messagePattern":"`(.+?)` parameter has no effect when using `from_arrow\\(<ArrowStreamExportable>\\)`","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/convert/general.py","lineNumber":557,"sourceCode":"        2\n        3\n    ]\n    \"\"\"  # noqa: W505\n    if is_pycapsule(data) and not _check_for_pyarrow(data):\n        unsupported_parameter = (\n            \"schema\"\n            if schema is not None\n            else \"schema_overrides\"\n            if schema_overrides is not None\n            else None\n        )\n\n        if unsupported_parameter:\n            msg = (\n                f\"`{unsupported_parameter}` parameter has no effect when using \"\n                \"`from_arrow(<ArrowStreamExportable>)`\"\n            )\n            raise TypeError(msg)\n\n        ret = pl.Series(data)\n\n        if rechunk:\n            ret = ret.rechunk()\n\n        return ret\n\n    elif isinstance(data, (pa.Table, pa.RecordBatch)):\n        return wrap_df(\n            arrow_to_pydf(\n                data=data,\n                rechunk=rechunk,\n                schema=schema,\n                schema_overrides=schema_overrides,\n            )\n        )\n    elif isinstance(data, (pa.Array, pa.ChunkedArray)):","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/pola-rs/polars/blob/5d8ebabf11caea54a5c29178a64a058762f49766/py-polars/src/polars/convert/general.py#L539-L575","documentation":"TypeError raised by pl.from_arrow when a non-None convenience parameter (e.g. rechunk, schema_overrides) is passed while the input is an ArrowStreamExportable object consumed via the PyCapsule/Arrow PyCapsule Interface stream path. On that zero-copy path polars cannot apply those parameters, so it refuses instead of silently ignoring them.","triggerScenarios":"pl.from_arrow(arrow_stream_object, rechunk=True) or similar, where the object only exposes __arrow_c_stream__ and therefore takes the PyCapsule branch in py-polars/src/polars/convert/general.py:557.","commonSituations":"Passing a RecordBatchReader or arrow-stream capsule object from libraries like pyarrow/arro3 and also setting rechunk=True; generic wrapper functions that always pass rechunk regardless of input type.","solutions":["Drop the unsupported parameter (call pl.from_arrow(obj)) and rechunk/specialize afterwards on the returned frame","If the input is a plain pyarrow Table/Array/array of chunks, those parameters work — convert the stream to a table first (obj.read_all() for RecordBatchReader)","Branch in wrapper code: only pass rechunk when the object is not ArrowStreamExportable"],"exampleFix":"# before\npl.from_arrow(reader, rechunk=True)  # reader: RecordBatchReader\n# after\ndf = pl.from_arrow(reader)\ndf = df.rechunk()","handlingStrategy":"type-guard","validationCode":"from pyarrow import RecordBatchReader\nunsupported = not isinstance(data, RecordBatchReader) and hasattr(data, '__arrow_c_stream__')\nif unsupported:\n    data, rechunk = data, None","typeGuard":"def is_stream_capsule(obj: object) -> bool:\n    return hasattr(obj, '__arrow_c_stream__') and not hasattr(obj, '__arrow_array__')","tryCatchPattern":"try:\n    pl.from_arrow(obj, rechunk=rechunk)\nexcept TypeError as e:\n    if 'has no effect' in str(e):\n        df = pl.from_arrow(obj)\n        return df.rechunk() if rechunk else df\n    raise","preventionTips":["Only pass rechunk for pyarrow Table/ChunkedArray inputs","Materialize streams to tables when you need post-processing options","Centralize arrow ingestion in one helper that branches by input type"],"tags":["python","polars","arrow","pycapsule","from-arrow"],"backgroundTag":"arrow-capsule-parameter-mismatch","analyzedSha":"5d8ebabf11caea54a5c29178a64a058762f49766","analyzedAt":"2026-08-28T18:02:35.179Z","contentChangedAt":"2026-08-28T18:02:35.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}