{"record":{"id":"295fb9f930223c4d","repo":"pola-rs/polars","slug":"query-monitoring-is-not-supported-by-the-gpu-engin","errorCode":null,"errorMessage":"query monitoring is not supported by the GPU engine","messagePattern":"query monitoring is not supported by the GPU engine","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/engine.py","lineNumber":917,"sourceCode":"    back to the CPU engine.\n    \"\"\"\n    config: Mapping[str, Any]\n    \"\"\"Additional configuration options for the engine.\"\"\"\n\n    def __init__(\n        self,\n        *,\n        device: int | None = None,\n        memory_resource: Any | None = None,\n        raise_on_fail: bool = False,\n        monitoring: bool = False,\n        **kwargs: Any,\n    ) -> None:\n        # We do want a named param for `monitoring`, because otherwise it will silently\n        # end up in `kwargs`\n        if monitoring:\n            msg = \"query monitoring is not supported by the GPU engine\"\n            raise NotImplementedError(msg)\n        super().__init__(monitoring=False)\n\n        self.device = device\n        self.memory_resource = memory_resource\n        # Avoids need for changes in cudf-polars\n        kwargs[\"raise_on_fail\"] = raise_on_fail\n        self.config = kwargs\n\n    def _post_opt_callback(\n        self, *, background: bool, eager: bool\n    ) -> Callable[[Any, int | None], None] | None:\n        if background:\n            issue_warning(\n                \"GPU engine does not support background collection, disabling GPU engine.\",\n                category=UserWarning,\n            )\n            return None\n        if eager:","sourceCodeStart":899,"sourceCodeEnd":935,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/py-polars/src/polars/lazyframe/engine.py#L899-L935","documentation":"GPUEngine constructor guard: monitoring=True was requested, but the GPU engine has no query-monitoring facility, so __init__ raises immediately. Any truthy `monitoring` argument triggers it; it is a capability check, not a runtime failure.","triggerScenarios":"Thrown at py-polars/src/polars/lazyframe/engine.py:937 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the query on the CPU engine if you need query monitoring; the GPU engine does not support it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"68506541d2de983056c9eb244e1ea05fab377dfc","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}