{"record":{"id":"5e63c3a3d7e8cefb","repo":"pola-rs/polars","slug":"sink-ipc-is-not-supported-by-type-self-name","errorCode":null,"errorMessage":"`sink_ipc` is not supported by {type(self).__name__}","messagePattern":"`sink_ipc` is not supported by (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/engine.py","lineNumber":271,"sourceCode":"        path: str | Path | IO[bytes] | PartitionBy,\n        *,\n        compression: IpcCompression | None,\n        compat_level: CompatLevel | None,\n        record_batch_size: int | None,\n        maintain_order: bool,\n        storage_options: StorageOptionsDict | None,\n        credential_provider: CredentialProviderFunction | Literal[\"auto\"] | None,\n        retries: int | None,\n        sync_on_close: SyncOnCloseMethod | None,\n        mkdir: bool,\n        lazy: bool,\n        optimizations: QueryOptFlags,\n        _record_batch_statistics: bool,\n        sinked_paths_callback: SinkedPathsCallback | None,\n    ) -> LazyFrame | None:\n        \"\"\"See :meth:`polars.LazyFrame.sink_ipc`.\"\"\"\n        msg = f\"`sink_ipc` is not supported by {type(self).__name__}\"\n        raise NotImplementedError(msg)\n\n    def sink_csv(\n        self,\n        lf: LazyFrame,\n        path: str | Path | IO[bytes] | IO[str] | PartitionBy,\n        *,\n        include_bom: bool,\n        compression: Literal[\"uncompressed\", \"gzip\", \"zstd\"],\n        compression_level: int | None,\n        check_extension: bool,\n        include_header: bool,\n        separator: str,\n        line_terminator: str,\n        quote_char: str,\n        batch_size: int,\n        datetime_format: str | None,\n        date_format: str | None,\n        time_format: str | None,","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/lazyframe/engine.py#L253-L289","documentation":"`Engine.sink_ipc` (engine.py:271) is the optional `Engine` hook behind `LazyFrame.sink_ipc` (Arrow IPC/Feather output). Its default stub raises `NotImplementedError` naming the engine class. Every built-in engine supports it (`_LocalEngine` family natively, `RemoteEngine` through Polars Cloud), so the error signals a custom `Engine` subclass that did not override the method.","triggerScenarios":"`lf.sink_ipc(path, engine=my_engine)` with a custom engine that only implements `collect`/`execute`. Typical with prototype backends or mock engines used in integration tests of sink pipelines.","commonSituations":"Teams extending Polars with an in-house backend (e.g. executing plans on a proprietary store) that covers collect but not sinks yet; test doubles that assert on plan construction but break when the fixture code calls a sink; tutorials on custom engines that predate the sink API.","solutions":["Use a built-in engine for the sink: `lf.sink_ipc(path, engine='streaming')` or `engine=pl.RemoteEngine()` for cloud targets","Implement `sink_ipc` on your `Engine` subclass matching the stub's keyword signature (compression, compat_level, record_batch_size, maintain_order, storage_options, credential_provider, retries, sync_on_close, mkdir, lazy, optimizations, _record_batch_statistics, sinked_paths_callback)","Stopgap: `lf.collect().write_ipc(path)`","Gate sink calls on a capability check when the engine is selected at runtime"],"exampleFix":"# before\nlf.sink_ipc('out.arrow', engine=my_custom_engine)  # NotImplementedError\n\n# after\nlf.sink_ipc('out.arrow', engine='streaming')\n# or implement `sink_ipc` on MyEngine with the stub's signature","handlingStrategy":"validation","validationCode":"from polars.lazyframe.engine import Engine\n\ndef engine_can_sink_ipc(engine: pl.Engine) -> bool:\n    return type(engine).sink_ipc is not Engine.sink_ipc\n\nengine = my_engine if engine_can_sink_ipc(my_engine) else pl.StreamingEngine()","typeGuard":null,"tryCatchPattern":"try:\n    lf.sink_ipc(path, engine=my_engine)\nexcept NotImplementedError as e:\n    if 'sink_ipc' in str(e):\n        lf.collect().write_ipc(path)\n    else:\n        raise","preventionTips":["When adding a custom engine, mirror the full sink signature from the ABC stub","Keep an eager write_ipc fallback in sink utilities that accept pluggable engines","Unit-test every LazyFrame sink format against your engine, not just collect"],"tags":["polars","engine","sink","ipc","not-implemented","plugin"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}