{"record":{"id":"38fc33ceac16f3f3","repo":"pola-rs/polars","slug":"functionality-for-nan-as-null-has-not-been-imple","errorCode":null,"errorMessage":"functionality for `nan_as_null` has not been implemented and the parameter will be removed in a future version\\n\\nUse the default `nan_as_null=False`.","messagePattern":"functionality for `nan_as_null` has not been implemented and the parameter will be removed in a future version\\\\n\\\\nUse the default `nan_as_null=False`\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/interchange/dataframe.py","lineNumber":64,"sourceCode":"        ----------\n        nan_as_null\n            Overwrite null values in the data with `NaN`.\n\n            .. warning::\n                This functionality has not been implemented and the parameter will be\n                removed in a future version.\n                Setting this to `True` will raise a `NotImplementedError`.\n        allow_copy\n            Allow memory to be copied to perform the conversion. If set to `False`,\n            causes conversions that are not zero-copy to fail.\n        \"\"\"\n        if nan_as_null:\n            msg = (\n                \"functionality for `nan_as_null` has not been implemented and the\"\n                \" parameter will be removed in a future version\"\n                \"\\n\\nUse the default `nan_as_null=False`.\"\n            )\n            raise NotImplementedError(msg)\n        return PolarsDataFrame(self._df, allow_copy=allow_copy)\n\n    @property\n    def metadata(self) -> dict[str, Any]:\n        \"\"\"The metadata for the dataframe.\"\"\"\n        return {}\n\n    def num_columns(self) -> int:\n        \"\"\"Return the number of columns in the dataframe.\"\"\"\n        return self._df.width\n\n    def num_rows(self) -> int:\n        \"\"\"Return the number of rows in the dataframe.\"\"\"\n        return self._df.height\n\n    def num_chunks(self) -> int:\n        \"\"\"\n        Return the number of chunks the dataframe consists of.","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/py-polars/src/polars/interchange/dataframe.py#L46-L82","documentation":"Raised when constructing the interchange PolarsDataFrame with nan_as_null=True. The parameter is accepted for API compatibility but the NaN-to-null conversion was never implemented; only the default nan_as_null=False is valid, and setting True always raises NotImplementedError. Rewrite the data with fill_nan(Null) before conversion if needed.","triggerScenarios":"Thrown at py-polars/src/polars/interchange/dataframe.py:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the nan_as_null argument or set nan_as_null=False; the nan_as_null=True behavior is unimplemented and the parameter is deprecated."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}