{"record":{"id":"6d0deac905426426","repo":"pola-rs/polars","slug":"expected-statistics-to-be-found-instead","errorCode":null,"errorMessage":"Expected Statistics to be {}, found {} instead","messagePattern":"Expected Statistics to be (.+?), found (.+?) instead","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-parquet/src/parquet/statistics/mod.rs","lineNumber":181,"sourceCode":"                }\n\n                #[doc = concat!(\"Try to take [`Statistics`] as [`\", stringify!($struct), \"`]\")]\n                #[inline]\n                pub fn $into_ident(self) -> Option<$struct> {\n                    match self {\n                        Self::$variant(s) => Some(s),\n                        _ => None,\n                    }\n                }\n\n                #[doc = concat!(\"Interpret [`Statistics`] to be [`\", stringify!($struct), \"`]\")]\n                ///\n                /// Panics if it is not the correct variant.\n                #[track_caller]\n                #[inline]\n                pub fn $expect_ident(&self) -> &$struct {\n                    let Self::$variant(s) = self else {\n                        panic!(\"Expected Statistics to be {}, found {} instead\", stringify!($struct), self.variant_str());\n                    };\n\n                    s\n                }\n\n                #[doc = concat!(\"Interpret [`Statistics`] to be [`\", stringify!($struct), \"`]\")]\n                ///\n                /// Panics if it is not the correct variant.\n                #[track_caller]\n                #[inline]\n                pub fn $owned_expect_ident(self) -> $struct {\n                    let Self::$variant(s) = self else {\n                        panic!(\"Expected Statistics to be {}, found {} instead\", stringify!($struct), self.variant_str());\n                    };\n\n                    s\n                }\n            )+","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-parquet/src/parquet/statistics/mod.rs#L163-L199","documentation":"Documented panic of the Statistics interpret method: the stored Statistics variant does not match the requested concrete type (e.g. interpreting Int64 statistics as Boolean). Use the try_into variant (returns Option) to handle mismatches gracefully.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"Expected Statistics to be {}, found {} instead\". 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 (\"Expected Statistics to be {}, found {} instead\"). 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":["The statistics type does not match the column type; verify the parquet file was written correctly.","Ignore/fix mismatched statistics by rewriting the file or disabling statistics usage."],"exampleFix":null,"handlingStrategy":"type-guard","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"}