{"record":{"id":"41cdfa4535d9c924","repo":"pola-rs/polars","slug":"writing-to-json","errorCode":null,"errorMessage":"Writing {:?} to JSON","messagePattern":"Writing (.+?) to JSON","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-json/src/json/write/serialize.rs","lineNumber":634,"sourceCode":"                convert,\n                offset,\n                take,\n            )\n        },\n        ArrowDataType::Time64(tu) => {\n            let convert = match tu {\n                TimeUnit::Nanosecond => time64ns_to_time,\n                tu => panic!(\"Invalid time unit '{tu:?}' for Time.\"),\n            };\n            time_serializer(\n                array.as_any().downcast_ref().unwrap(),\n                convert,\n                offset,\n                take,\n            )\n        },\n        ArrowDataType::Null => null_serializer(array.len(), offset, take),\n        other => todo!(\"Writing {:?} to JSON\", other),\n    }\n}\n\nfn serialize_item<'a>(\n    buffer: &mut Vec<u8>,\n    record: impl Iterator<Item = (&'a str, &'a [u8])>,\n    is_first_row: bool,\n) {\n    if !is_first_row {\n        buffer.push(b',');\n    }\n    buffer.push(b'{');\n    let mut first_item = true;\n    for (key, value) in record {\n        if !first_item {\n            buffer.push(b',');\n        }\n        first_item = false;","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-json/src/json/write/serialize.rs#L616-L652","documentation":"todo!() in polars-json serialization dispatch: the array's ArrowDataType has no JSON serializer implemented in this build, so writing it to JSON cannot proceed. Signals unsupported functionality for that dtype, not invalid data.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"Writing {:?} to JSON\". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"Writing {:?} to JSON\"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.","solutions":["JSON writing is not implemented for this dtype; cast the column to a supported type (string/numeric) before serializing.","Convert nested/unsupported values to strings before writing JSON."],"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-14T05:17:10.506Z"}