{"record":{"id":"f0906e9e1f7bb2f1","repo":"pola-rs/polars","slug":"all-dictionary-types-have-dict-id","errorCode":null,"errorMessage":"All Dictionary types have `dict_id`","messagePattern":"All Dictionary types have `dict_id`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-arrow/src/io/ipc/write/schema.rs","lineNumber":143,"sourceCode":"\n    let type_ = serialize_type(field.dtype());\n    let children = serialize_children(field.dtype(), ipc_field);\n\n    let dictionary = if let ArrowDataType::Dictionary(index_type, inner, is_ordered) =\n        field.dtype().to_storage()\n    {\n        if let ArrowDataType::Extension(ext) = inner.as_ref() {\n            write_extension(\n                ext.name.as_str(),\n                ext.metadata.as_ref().map(|x| x.as_str()),\n                &mut kv_vec,\n            );\n        }\n        Some(serialize_dictionary(\n            index_type,\n            ipc_field\n                .dictionary_id\n                .expect(\"All Dictionary types have `dict_id`\"),\n            *is_ordered,\n        ))\n    } else {\n        None\n    };\n\n    if let Some(metadata) = &field.metadata {\n        write_metadata(metadata, &mut kv_vec);\n    }\n\n    let custom_metadata = if !kv_vec.is_empty() {\n        Some(kv_vec)\n    } else {\n        None\n    };\n\n    polars_arrow_format::ipc::Field {\n        name: Some(field.name.to_string()),","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-arrow/src/io/ipc/write/schema.rs#L125-L161","documentation":"serialize_field asserts (via expect) that every Dictionary dtype carries a dict_id when converting Arrow fields to IPC fields. The panic fires when a dictionary field's IPC metadata lacks a dictionary id — usually a schema produced outside the normal IPC write path.","triggerScenarios":"Thrown at crates/polars-arrow/src/io/ipc/write/schema.rs:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure ipc_field.dictionary_id is populated for dictionary-typed fields before serializing","Construct the IpcField tree with the same shape and ordering as the Arrow schema","Avoid hand-building IpcSchema/IpcField metadata for dictionary columns"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}