{"record":{"id":"f5d25b530e3defa8","repo":"pola-rs/polars","slug":"not-implemented-f5d25b","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-compute/src/comparisons/null.rs","lineNumber":40,"sourceCode":"\n    fn tot_ne_kernel_broadcast(&self, _other: &Self::Scalar) -> Bitmap {\n        todo!()\n    }\n}\n\nimpl TotalOrdKernel for NullArray {\n    type Scalar = Box<dyn Array>;\n\n    fn tot_lt_kernel(&self, _other: &Self) -> Bitmap {\n        unimplemented!()\n    }\n\n    fn tot_le_kernel(&self, _other: &Self) -> Bitmap {\n        unimplemented!()\n    }\n\n    fn tot_lt_kernel_broadcast(&self, _other: &Self::Scalar) -> Bitmap {\n        unimplemented!()\n    }\n\n    fn tot_le_kernel_broadcast(&self, _other: &Self::Scalar) -> Bitmap {\n        unimplemented!()\n    }\n\n    fn tot_gt_kernel_broadcast(&self, _other: &Self::Scalar) -> Bitmap {\n        unimplemented!()\n    }\n\n    fn tot_ge_kernel_broadcast(&self, _other: &Self::Scalar) -> Bitmap {\n        unimplemented!()\n    }\n}\n","sourceCodeStart":22,"sourceCodeEnd":55,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-compute/src/comparisons/null.rs#L22-L55","documentation":"polars-compute implements TotalOrdKernel (total-order comparisons backing <, <= and ordering-sensitive ops) for most arrays, but NullArray - the Arrow array behind polars' Null dtype (an all-null column) - has unimplemented!() stubs. tot_lt_kernel panics with 'not implemented' as soon as it is called. Equality kernels on NullArray are implemented; ordering deliberately is not.","triggerScenarios":"An inequality comparison on a Null-dtype column: pl.col(\"n\") < pl.col(\"n2\") or Series.lt/lt_eq where an operand has dtype pl.Null, range predicates such as is_between that lower to gt_lt/tot_lt kernels with Null operands, and any direct Rust call to tot_lt_kernel on a NullArray.","commonSituations":"All-null columns arise easily: empty join results, pl.lit(None) typed as Null, CSV/JSON columns where every value is missing, or generic code that processes arbitrary schemas. Sorting or range-filtering such a column - often a rarely exercised branch - then panics.","solutions":["Cast the Null column to a concrete dtype before ordering: pl.col(\"n\").cast(pl.String) or the dtype the column should have had","Replace ordering predicates on Null columns with null-aware logic: pl.col(\"n\").is_null() / is_not_null(), which never enters the ordering kernel","Drop all-Null columns early: df.drop([c for c, t in df.schema.items() if t == pl.Null])"],"exampleFix":"# before\ndf.filter(pl.col(\"empty\") < pl.col(\"empty2\"))  # both dtype pl.Null -> unimplemented\n# after\ndf.filter(pl.col(\"empty\").cast(pl.Int64) < pl.col(\"empty2\").cast(pl.Int64))","handlingStrategy":"type-guard","validationCode":"# before ordering/filtering generically over columns\nnull_cols = [c for c, t in df.schema.items() if t == pl.Null]\nif null_cols:\n    df = df.with_columns([pl.col(c).cast(pl.String) for c in null_cols])","typeGuard":"# Python\ndef is_null_dtype(s: pl.Series) -> bool:\n    return s.dtype == pl.Null","tryCatchPattern":null,"preventionTips":["Provide explicit dtypes when scanning files so all-missing columns are not typed Null","Drop or cast pl.Null columns early in generic pipelines","Prefer is_null()/is_not_null() over ordering predicates on possibly-Null columns"],"tags":["polars","null-dtype","comparison","total-ord","panic","unimplemented-macro"],"backgroundTag":"null-dtype-ordering","analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}