{"record":{"id":"490143273dc66ccf","repo":"pola-rs/polars","slug":"data-types-of-values-should-match","errorCode":null,"errorMessage":"data types of values should match","messagePattern":"data types of values should match","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/series/any_value.rs","lineNumber":24,"sourceCode":"\n#[cfg(feature = \"dtype-categorical\")]\nuse crate::chunked_array::builder::CategoricalChunkedBuilder;\nuse crate::chunked_array::builder::{AnonymousOwnedListBuilder, get_list_builder};\nuse crate::prelude::*;\nuse crate::utils::any_values_to_supertype;\n\nimpl<'a, T: AsRef<[AnyValue<'a>]>> NamedFrom<T, [AnyValue<'a>]> for Series {\n    /// Construct a new [`Series`] from a collection of [`AnyValue`].\n    ///\n    /// # Panics\n    ///\n    /// Panics if the values do not all share the same data type (with the exception\n    /// of [`DataType::Null`], which is always allowed).\n    ///\n    /// [`AnyValue`]: crate::datatypes::AnyValue\n    fn new(name: PlSmallStr, values: T) -> Self {\n        let values = values.as_ref();\n        Series::from_any_values(name, values, true).expect(\"data types of values should match\")\n    }\n}\n\nimpl Series {\n    /// Construct a new [`Series`] from a slice of AnyValues.\n    ///\n    /// The data type of the resulting Series is determined by the `values`\n    /// and the `strict` parameter:\n    /// - If `strict` is `true`, the data type is equal to the data type of the\n    ///   first non-null value. If any other non-null values do not match this\n    ///   data type, an error is raised. If the first non-null value is a\n    ///   decimal the slice is scanned for the maximum precision and scale possible.\n    /// - If `strict` is `false`, the data type is the supertype of the `values`.\n    ///   An error is returned if no supertype can be determined.\n    ///   **WARNING**: A full pass over the values is required to determine the supertype.\n    /// - If no values were passed, the resulting data type is `Null`.\n    pub fn from_any_values(\n        name: PlSmallStr,","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/crates/polars-core/src/series/any_value.rs#L6-L42","documentation":"Error \"data types of values should match\" thrown in pola-rs/polars.","triggerScenarios":"Thrown at crates/polars-core/src/series/any_value.rs:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}