pola-rs/polars · error · TypeError

`{unsupported_parameter}` parameter has no effect when using

Error message

`{unsupported_parameter}` parameter has no effect when using `from_arrow(<ArrowStreamExportable>)`

What it means

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.

Source

Thrown at py-polars/src/polars/convert/general.py:557

        2
        3
    ]
    """  # noqa: W505
    if is_pycapsule(data) and not _check_for_pyarrow(data):
        unsupported_parameter = (
            "schema"
            if schema is not None
            else "schema_overrides"
            if schema_overrides is not None
            else None
        )

        if unsupported_parameter:
            msg = (
                f"`{unsupported_parameter}` parameter has no effect when using "
                "`from_arrow(<ArrowStreamExportable>)`"
            )
            raise TypeError(msg)

        ret = pl.Series(data)

        if rechunk:
            ret = ret.rechunk()

        return ret

    elif isinstance(data, (pa.Table, pa.RecordBatch)):
        return wrap_df(
            arrow_to_pydf(
                data=data,
                rechunk=rechunk,
                schema=schema,
                schema_overrides=schema_overrides,
            )
        )
    elif isinstance(data, (pa.Array, pa.ChunkedArray)):

View on GitHub (pinned to 5d8ebabf11)

Solutions

  1. Drop the unsupported parameter (call pl.from_arrow(obj)) and rechunk/specialize afterwards on the returned frame
  2. 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)
  3. Branch in wrapper code: only pass rechunk when the object is not ArrowStreamExportable

Example fix

# before
pl.from_arrow(reader, rechunk=True)  # reader: RecordBatchReader
# after
df = pl.from_arrow(reader)
df = df.rechunk()
Defensive patterns

Strategy: type-guard

Validate before calling

from pyarrow import RecordBatchReader
unsupported = not isinstance(data, RecordBatchReader) and hasattr(data, '__arrow_c_stream__')
if unsupported:
    data, rechunk = data, None

Type guard

def is_stream_capsule(obj: object) -> bool:
    return hasattr(obj, '__arrow_c_stream__') and not hasattr(obj, '__arrow_array__')

Try / catch

try:
    pl.from_arrow(obj, rechunk=rechunk)
except TypeError as e:
    if 'has no effect' in str(e):
        df = pl.from_arrow(obj)
        return df.rechunk() if rechunk else df
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of pola-rs/polars@5d8ebabf11 (2026-08-28). Data as JSON: /api/errors/4576cacb1bab69d7. Report an issue: GitHub.