{"record":{"id":"d4e45330c3d17d50","repo":"influxdata/influxdb","slug":"expected-datatime-column-value-but-got-got-val","errorCode":null,"errorMessage":"expected datatime column value but got: {got_val:?}","messagePattern":"expected datatime column value but got: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/partition/src/lib.rs","lineNumber":1657,"sourceCode":"                            got_val.is_prefix_match_of(want_val),\n                            \"prefix mismatch; {got_val:?} is not a prefix of {want_val:?}\",\n                        );\n                    },\n                    ColumnValue::Prefix(_) => {\n                        let want_val = want_val.expect_string();\n                        assert!(\n                            got_val.is_prefix_match_of(want_val),\n                            \"prefix mismatch; {got_val:?} is not a prefix of {want_val:?}\",\n                        );\n                    },\n                    ColumnValue::Datetime{..} => {\n                        let (want_begin, want_end) = want_val.expect_ts_range();\n                        match got_val {\n                            ColumnValue::Datetime{begin, end} => {\n                                assert_eq!(want_begin, *begin);\n                                assert_eq!(want_end, *end);\n                            }\n                            _ => panic!(\"expected datatime column value but got: {got_val:?}\")\n                        }\n                    },\n                    ColumnValue::Bucket{id: got_bucket_id, num_buckets: got_num_buckets} => {\n                        let (want_bucket_id, want_num_buckets) = want_val.expect_bucket();\n                        assert_eq!(*got_bucket_id, want_bucket_id);\n                        assert_eq!(*got_num_buckets, want_num_buckets);\n                    }\n                };\n            }\n        }\n\n        /// A property test that asserts the partitioner tolerates (does not\n        /// panic) randomised, potentially invalid strftime formatter strings.\n        #[test]\n        fn prop_arbitrary_strftime_format(fmt in any::<String>()) {\n            let mut batch = MutableBatch::new();\n            let mut writer = Writer::new(&mut batch, 1);\n","sourceCodeStart":1639,"sourceCodeEnd":1675,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/partition/src/lib.rs#L1639-L1675","documentation":"A test assertion panicking when the produced ColumnValue is not ColumnValue::Datetime while the expected value was a timestamp range. In the property tests comparing partition output, a Datetime {begin, end} is required; any other variant (String, Bucket) trips this panic with a debug dump of the actual value.","triggerScenarios":"Calling expect_ts_range() on the expected value but the actual partition output was ColumnValue::String or ColumnValue::Bucket rather than Datetime — e.g. template rendered as string or bucket instead of a datetime range.","commonSituations":"Test fixtures with templates that don't produce datetime ranges (missing/incorrect time part); asserting against bucketed output with datetime expectations.","solutions":["Align the template configuration so the part produces a Datetime range","Match on the actual variant and use expect_bucket()/string assertions as appropriate","Inspect the {got_val:?} debug output in the panic to identify which variant was produced and why"],"exampleFix":"// before\nmatch got_val {\n    ColumnValue::Datetime{begin, end} => { assert_eq!(want_begin, *begin); }\n    _ => panic!(\"expected datatime column value but got: {got_val:?}\")\n}\n// after\nmatch got_val {\n    ColumnValue::Datetime{begin, end} => { assert_eq!(want_begin, *begin); assert_eq!(want_end, *end); }\n    other => panic!(\"unexpected partition value variant {:?}; check template part configuration\", other),\n}","handlingStrategy":"type-guard","validationCode":"if !matches!(got_val, ColumnValue::Datetime{..}) {\n    panic!(\"expected Datetime partition value, got {got_val:?}; check template part config\");\n}","typeGuard":"fn is_datetime(v: &ColumnValue) -> bool { matches!(v, ColumnValue::Datetime{..}) }","tryCatchPattern":null,"preventionTips":["Configure template parts so expected variants are actually produced","Read the {got_val:?} debug output in panics to identify mismatches","Cover each ColumnValue variant with a dedicated assertion path"],"tags":["rust","panic","test-assertion","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}