{"record":{"id":"7a523b1ce15860eb","repo":"pola-rs/polars","slug":"not-implemented-7a523b","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-arrow/src/pushable.rs","lineNumber":282,"sourceCode":"    type Freeze = BooleanArray;\n    #[inline]\n    fn reserve(&mut self, additional: usize) {\n        MutableBooleanArray::reserve(self, additional)\n    }\n\n    #[inline]\n    fn push(&mut self, value: bool) {\n        MutableBooleanArray::push_value(self, value)\n    }\n\n    #[inline]\n    fn len(&self) -> usize {\n        self.values().len()\n    }\n\n    #[inline]\n    fn push_null(&mut self) {\n        unimplemented!()\n    }\n\n    #[inline]\n    fn extend_constant(&mut self, additional: usize, value: bool) {\n        MutableBooleanArray::extend_constant(self, additional, Some(value))\n    }\n\n    #[inline]\n    fn extend_null_constant(&mut self, _additional: usize) {\n        unimplemented!()\n    }\n    fn freeze(self) -> Self::Freeze {\n        self.into()\n    }\n}\n\nimpl Pushable<Option<bool>> for MutableBooleanArray {\n    type Freeze = BooleanArray;","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/crates/polars-arrow/src/pushable.rs#L264-L300","documentation":"The Pushable trait abstracts mutable output arrays for generic kernels. The non-null instantiation Pushable<bool> for MutableBooleanArray implements push and extend_constant, but push_null is a TODO: unimplemented!() (crates/polars-arrow/src/pushable.rs:282). Generic code parameterized over Pushable<bool> panics the first time it must propagate a null slot into the boolean output, e.g. when the input contained nulls.","triggerScenarios":"A generic kernel written as fn run<P: Pushable<bool>>(out: &mut P, ...) that calls out.push_null() — typically string/view/regexp kernels emitting boolean masks when the source array has null values.","commonSituations":"Writing new polars-compute or polars-arrow kernels against Pushable; refactoring Option<bool> kernels to plain bool to dodge unwrap; fuzz tests that include null inputs where nullability was assumed away.","solutions":["Use the Pushable<Option<bool>> impl instead (it implements push_null via push(None)) and push Some(v)/None","Call the inherent MutableBooleanArray::push(None) / push_null() method directly rather than the trait method","Constrain generic kernels to Pushable<Option<B>> so nullability is part of the contract","Upstream: implement push_null as MutableBooleanArray::push_null(self) — the inherent method already exists"],"exampleFix":"// before\nfn emit<P: Pushable<bool>>(out: &mut P, v: Option<bool>) {\n    match v {\n        Some(v) => out.push(v),\n        None => out.push_null(), // panics: unimplemented!()\n    }\n}\n\n// after\nfn emit<P: Pushable<Option<bool>>>(out: &mut P, v: Option<bool>) {\n    out.push(v); // None is handled by the Option impl\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":"fn supports_null<T, P: Pushable<T>>(_: &P) -> bool { /* false for Pushable<bool>, true for Pushable<Option<bool>> */ }\n// practical guard: write kernels against the Option impl\nfn kernel<P: Pushable<Option<bool>>>(out: &mut P, v: Option<bool>) {\n    out.push(v);\n}","tryCatchPattern":"let res = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| out.push_null()));\nif res.is_err() {\n    // fall back to the inherent, null-aware API\n    MutableBooleanArray::push_null(out);\n}","preventionTips":["Model output nullability in the type parameter: use Pushable<Option<bool>> for boolean outputs that can hold nulls","Audit generic kernels for push_null/extend_null_constant calls before instantiating with bool","Cover null inputs in kernel unit tests"],"tags":["rust","polars-arrow","pushable","boolean","null","panic"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}