{"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":null,"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/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/convert/general.py#L539-L575","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Remove the schema/schema_overrides (and other unsupported) parameters when input is an Arrow stream.","If you must apply a schema, convert to a table or list first: pl.from_arrow(data.read_all(), schema=...).","Call .cast(schema) on the resulting DataFrame instead of passing schema to from_arrow.","Catch TypeError and retry without the optional parameters."],"exampleFix":"// before\ndf = pl.from_arrow(duckdb_result.arrow(), schema={\"a\": pl.Int64})\n// after\ndf = pl.from_arrow(duckdb_result.arrow()).cast({\"a\": pl.Int64})","handlingStrategy":"try-catch","validationCode":"if hasattr(data, \"__arrow_c_stream__\") and (schema is not None or schema_overrides is not None):\n    raise ValueError(\"cannot pass schema params with an Arrow stream; use .cast() afterwards\")\npl.from_arrow(data, schema=schema)","typeGuard":"def is_arrow_stream_exportable(v) -> bool:\n    return hasattr(v, \"__arrow_c_stream__\")","tryCatchPattern":"try:\n    df = pl.from_arrow(data, schema=schema)\nexcept TypeError:\n    df = pl.from_arrow(data).cast(schema or {})","preventionTips":["Only pass rechunk (and other stream-supported params) with ArrowStreamExportable inputs.","Apply schemas with .cast() or .schema() on the resulting frame instead.","If a schema is essential, materialize the stream to a table first (e.g. pa.Table)."],"tags":["python","polars","arrow","incompatible-parameters"],"backgroundTag":"conflicting-config-options","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"}