{"record":{"id":"529d7313865abd5c","repo":"pola-rs/polars","slug":"collect-all-is-not-supported-by-type-self-na","errorCode":null,"errorMessage":"`collect_all` is not supported by {type(self).__name__}","messagePattern":"`collect_all` is not supported by (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/engine.py","lineNumber":171,"sourceCode":"    def collect_batches(\n        self,\n        lf: LazyFrame,\n        *,\n        optimizations: QueryOptFlags,\n        maintain_order: bool = True,\n        chunk_size: int | None = None,\n        lazy: bool = False,\n    ) -> _CollectBatches:\n        \"\"\"Execute `lf`, yielding its result in batches.\"\"\"\n        msg = f\"`collect_batches` is not supported by {type(self).__name__}\"\n        raise NotImplementedError(msg)\n\n    def collect_all(\n        self, lfs: Iterable[LazyFrame], *, optimizations: QueryOptFlags\n    ) -> list[DataFrame]:\n        \"\"\"Execute several queries, potentially in parallel.\"\"\"\n        msg = f\"`collect_all` is not supported by {type(self).__name__}\"\n        raise NotImplementedError(msg)\n\n    def collect_all_async(\n        self,\n        lfs: Iterable[LazyFrame],\n        *,\n        optimizations: QueryOptFlags,\n        gevent: bool = False,\n    ) -> AsyncResult[list[DataFrame]]:\n        \"\"\"Execute several queries asynchronously.\"\"\"\n        msg = f\"`collect_all_async` is not supported by {type(self).__name__}\"\n        raise NotImplementedError(msg)\n\n    def sink_parquet(\n        self,\n        lf: LazyFrame,\n        path: str | Path | IO[bytes] | PartitionBy,\n        *,\n        compression: ParquetCompression,","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/lazyframe/engine.py#L153-L189","documentation":"`collect_all` runs several LazyFrames in parallel; it is an optional capability on the `Engine` interface. The base class raises NotImplementedError with this message for engines that do not implement multi-query parallel collection.","triggerScenarios":"Calling `pl.collect_all(lfs, engine=<engine>)` or `LazyFrame.collect_all` with an engine that lacks the `collect_all` override (e.g. a custom engine).","commonSituations":"Batch-reporting scripts collecting many frames at once with a custom or restricted engine; migrating code between engines where the new one lacks `collect_all`.","solutions":["Use the default engine (omit `engine`) which implements `collect_all`.","Loop over frames with `lf.collect()` per frame instead of `collect_all`.","Implement `collect_all` in your custom Engine to fan queries out to the backend.","Confirm the chosen engine's supported methods in polars documentation before using batch APIs."],"exampleFix":"// before\ndfs = pl.collect_all(lfs, engine=\"my-engine\")\n// after\ndfs = pl.collect_all(lfs)  # default engine","handlingStrategy":"try-catch","validationCode":"if type(engine_obj).collect_all is Engine.collect_all:\n    engine = None  # use default","typeGuard":"def supports_collect_all(engine: object) -> bool:\n    return type(engine).collect_all is not Engine.collect_all","tryCatchPattern":"try:\n    dfs = pl.collect_all(lfs, engine=eng)\nexcept NotImplementedError:\n    dfs = [lf.collect() for lf in lfs]","preventionTips":["Call collect_all without a custom engine","Implement collect_all in custom Engine classes","Keep an explicit per-frame collect fallback"],"tags":["python","polars","parallelism","not-implemented"],"backgroundTag":"method-not-implemented","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"}