pola-rs/polars · error

` ` parameter has no effect when using `from_arrow( )

Error message

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

What it means

When pl.from_arrow receives an ArrowStreamExportable (a zero-copy Arrow stream object), parameters like schema, schema_overrides, or other per-parameter options cannot be applied to the stream, so passing any unsupported parameter raises a TypeError naming the offending parameter. Only the accepted stream path parameters (e.g. rechunk) may be used.

Solutions

  1. Remove the schema/schema_overrides (and other unsupported) parameters when input is an Arrow stream.
  2. If you must apply a schema, convert to a table or list first: pl.from_arrow(data.read_all(), schema=...).
  3. Call .cast(schema) on the resulting DataFrame instead of passing schema to from_arrow.
  4. Catch TypeError and retry without the optional parameters.

Example fix

// before
df = pl.from_arrow(duckdb_result.arrow(), schema={"a": pl.Int64})
// after
df = pl.from_arrow(duckdb_result.arrow()).cast({"a": pl.Int64})
Defensive patterns

Strategy: try-catch

Validate before calling

if hasattr(data, "__arrow_c_stream__") and (schema is not None or schema_overrides is not None):
    raise ValueError("cannot pass schema params with an Arrow stream; use .cast() afterwards")
pl.from_arrow(data, schema=schema)

Type guard

def is_arrow_stream_exportable(v) -> bool:
    return hasattr(v, "__arrow_c_stream__")

Try / catch

try:
    df = pl.from_arrow(data, schema=schema)
except TypeError:
    df = pl.from_arrow(data).cast(schema or {})

Prevention

When it happens

Trigger: pl.from_arrow(arrow_stream_obj, schema=my_schema) or with schema_overrides/nan_to_null etc., where data implements __arrow_c_stream__ (e.g. a polars/duckdb/pandas Arrow-backed object).

Common situations: Passing a DuckDB result's arrow stream or a polars DataFrame back through from_arrow while keeping schema arguments from an earlier code path; refactors that changed the input from a table to a stream without dropping schema args.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of pola-rs/polars@fe841f959e (2026-09-18). Data as JSON: /api/errors/4576cacb1bab69d7. Report an issue: GitHub.

Appendix: 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 fe841f959e)