{"record":{"id":"3250a3395cc823fa","repo":"pola-rs/polars","slug":"collect-all-async-is-not-supported-by-type-self","errorCode":null,"errorMessage":"`collect_all_async` is not supported by {type(self).__name__}","messagePattern":"`collect_all_async` is not supported by (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/engine.py","lineNumber":182,"sourceCode":"        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,\n        compression_level: int | None,\n        statistics: bool | str | dict[str, bool],\n        row_group_size: int | None,\n        data_page_size: int | None,\n        maintain_order: bool,\n        storage_options: StorageOptionsDict | None,\n        credential_provider: CredentialProviderFunction | Literal[\"auto\"] | None,\n        sync_on_close: SyncOnCloseMethod | None,\n        metadata: ParquetMetadata | None,\n        arrow_schema: ArrowSchemaExportable | None,\n        mkdir: bool,","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/lazyframe/engine.py#L164-L200","documentation":"`collect_all_async` executes several LazyFrames asynchronously and is only available on engines implementing it. The base `Engine` stub raises NotImplementedError with this message, so invoking it on a non-async-capable engine fails.","triggerScenarios":"Calling `pl.collect_all_async(lfs, engine=<engine>)` with an engine that does not override `collect_all_async` (e.g. custom engine or base implementation reached).","commonSituations":"Async pipelines collecting many frames concurrently with a custom engine; examples written for the async in-process engine run against a different engine selection.","solutions":["Call `collect_all_async` without overriding the engine (use the async-capable default).","Fall back to synchronous `pl.collect_all(lfs)` wrapped in a thread/executor for non-blocking behavior.","Implement `collect_all_async` in your custom Engine returning `AsyncResult[list[DataFrame]]`.","Check engine capabilities before mixing async APIs with custom engines."],"exampleFix":"// before\nawait pl.collect_all_async(lfs, engine=\"custom\")\n// after\ndfs = pl.collect_all(lfs)","handlingStrategy":"try-catch","validationCode":"if type(engine_obj).collect_all_async is Engine.collect_all_async:\n    use_sync_collect_all = True","typeGuard":"def supports_async_all(engine: object) -> bool:\n    return type(engine).collect_all_async is not Engine.collect_all_async","tryCatchPattern":"try:\n    res = pl.collect_all_async(lfs, engine=eng)\nexcept NotImplementedError:\n    dfs = pl.collect_all(lfs)","preventionTips":["Use the async-capable default engine for collect_all_async","Implement the method when subclassing Engine","Guard async batch APIs with fallbacks"],"tags":["python","polars","async","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"}