{"record":{"id":"e129ec4e5b568def","repo":"pola-rs/polars","slug":"not-implemented-e129ec","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/polars-arrow/src/array/values.rs","lineNumber":88,"sourceCode":"                .downcast_ref::<ListArray<i64>>()\n                .unwrap()\n                .get_values_size(),\n            ArrowDataType::LargeBinary => self\n                .as_any()\n                .downcast_ref::<BinaryArray<i64>>()\n                .unwrap()\n                .get_values_size(),\n            ArrowDataType::Utf8View => self\n                .as_any()\n                .downcast_ref::<Utf8ViewArray>()\n                .unwrap()\n                .total_bytes_len(),\n            ArrowDataType::BinaryView => self\n                .as_any()\n                .downcast_ref::<BinaryViewArray>()\n                .unwrap()\n                .total_bytes_len(),\n            _ => unimplemented!(),\n        }\n    }\n}\n","sourceCodeStart":70,"sourceCodeEnd":92,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/crates/polars-arrow/src/array/values.rs#L70-L92","documentation":"Panic (unimplemented!()) in the ValueSize::get_values_size impl for ArrayRef in polars-arrow. This dispatch downcasts only LargeUtf8, FixedSizeList, LargeList, LargeBinary, Utf8View and BinaryView arrays (computing the offset-aware 'visible' values size); any other dtype inside the ArrayRef - primitives, Boolean, Null, or legacy Utf8/List/Binary - falls to the catch-all arm and panics. The method is meant for variable-length/nested payloads where raw len() does not reflect sliced offsets, so calling it on fixed-width arrays is unsupported.","triggerScenarios":"Calling `arr_ref.get_values_size()` on an ArrayRef wrapping an Int32/Float64/Boolean array, a Utf8Array<i32>, or a ListArray<i32>. Typically reached indirectly from polars internals (e.g. sizing values buffers for nested list gathering/extension) where an unexpected dtype flows into the ArrayRef-typed code path - most often a legacy 32-bit Utf8/List produced by external Arrow interop instead of the view/large variants Polars uses.","commonSituations":"Rust code handling generic ArrayRefs from Arrow IPC/FFI with legacy Utf8 or List types; mixed-dtype dispatch where only variable-length types should reach the call but a primitive slips through; upgrading polars versions that changed which dtypes are normalized to view types.","solutions":["Guard by dtype before calling: only invoke get_values_size() for LargeList/LargeBinary/LargeUtf8/FixedSizeList/Utf8View/BinaryView; use arr.len() for fixed-width arrays.","Normalize incoming Arrow data to Polars-native dtypes (Utf8View, BinaryView, LargeList, LargeBinary) before it enters polars code paths.","If reached from polars internals, inspect the column's actual dtype (schema print) and cast/rebuild it; report a minimal repro upstream if it is an internal invariant violation.","Upgrade polars - dispatch coverage in this match grows over releases."],"exampleFix":"// before (Rust)\nlet n = arr.get_values_size(); // panics for Int32/Boolean/Utf8<ArrayRef>\n\n// after\nlet n = match arr.dtype().to_physical_type() {\n    PhysicalType::LargeList\n    | PhysicalType::FixedSizeList\n    | PhysicalType::LargeBinary\n    | PhysicalType::LargeUtf8\n    | PhysicalType::BinaryView\n    | PhysicalType::Utf8View => arr.get_values_size(),\n    _ => arr.len(),\n};","handlingStrategy":"validation","validationCode":"// Rust\nuse polars_arrow::array::ValueSize;\nlet n = if matches!(arr.dtype(), ArrowDataType::LargeList(_) | ArrowDataType::FixedSizeList(_, _) | ArrowDataType::LargeBinary | ArrowDataType::LargeUtf8 | ArrowDataType::Utf8View | ArrowDataType::BinaryView) {\n    arr.get_values_size()\n} else {\n    arr.len()\n};","typeGuard":"// Rust\nfn supports_values_size(dt: &ArrowDataType) -> bool {\n    matches!(dt, ArrowDataType::LargeList(_) | ArrowDataType::FixedSizeList(_, _) | ArrowDataType::LargeBinary | ArrowDataType::LargeUtf8 | ArrowDataType::Utf8View | ArrowDataType::BinaryView)\n}","tryCatchPattern":"// Rust - contain the panic at a boundary if the dtype is untrusted\nlet size = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| arr.get_values_size()))\n    .unwrap_or_else(|_| arr.len());","preventionTips":["get_values_size() is only for variable-length/nested arrays; use arr.len() for primitives and Boolean.","Ensure legacy Utf8/List (32-bit) arrays are converted to view/large variants before entering polars code.","When writing generic ArrayRef code, match on dtype before calling offset-aware size methods."],"tags":["polars","rust","polars-arrow","panic","values-size","arrow","dtype","unimplemented"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}