{"record":{"id":"6c05e2356e33b385","repo":"dbt-labs/dbt-core","slug":"could-not-parse-rangepartitioning-range-start-as","errorCode":null,"errorMessage":"Could not parse 'RangePartitioning.Range.Start' as i64","messagePattern":"Could not parse 'RangePartitioning\\.Range\\.Start' as i64","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/bigquery/config/components/partition_by.rs","lineNumber":78,"sourceCode":"            copy_partitions: false,\n        })\n    } else {\n        None\n    };\n\n    let range_partition = if let Some(partition) = metadata.get(\"RangePartitioning.Field\") {\n        let field = partition.parse::<String>().unwrap();\n\n        Some(BigqueryPartitionConfig {\n            field,\n            data_type: \"int64\".to_string(),\n            __inner__: BigqueryPartitionConfigInner::Range(RangeConfig {\n                range: Range {\n                    start: metadata\n                        .get(\"RangePartitioning.Range.Start\")\n                        .map(|s| {\n                            s.parse::<i64>()\n                                .expect(\"Could not parse 'RangePartitioning.Range.Start' as i64\")\n                        })\n                        .unwrap(),\n                    end: metadata\n                        .get(\"RangePartitioning.Range.End\")\n                        .map(|s| {\n                            s.parse::<i64>()\n                                .expect(\"Could not parse 'RangePartitioning.Range.End' as i64\")\n                        })\n                        .unwrap(),\n                    interval: metadata\n                        .get(\"RangePartitioning.Range.Interval\")\n                        .map(|s| {\n                            s.parse::<i64>()\n                                .expect(\"Could not parse 'RangePartitioning.Range.Interval' as i64\")\n                        })\n                        .unwrap(),\n                },\n            }),","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/bigquery/config/components/partition_by.rs#L60-L96","documentation":"When rebuilding a BigQuery range-partition config from remote schema metadata, the 'RangePartitioning.Range.Start' string is parsed as i64 with .expect, so any non-integer value panics with this message. It is treated as corruption of the driver-provided metadata, since BigQuery's API should always report range bounds as integers.","triggerScenarios":"from_remote_state encounters metadata 'RangePartitioning.Range.Start' whose value fails i64 parsing (empty string, floats, quoted/formatted numbers like '1,000', or a placeholder set by another tool).","commonSituations":"A driver or middleware serializing range bounds as floats/strings with formatting; hand-edited or cached schema metadata; localized number formatting injected upstream; metadata produced by an older adapter version with different encoding.","solutions":["Print the raw metadata value and fix whatever writes it to emit a plain base-10 integer string.","Re-fetch the table metadata from BigQuery to replace stale/corrupted cached values.","If bounds may exceed i64 or be formatted, parse with a tolerant parser (f64 then validate, or i128) before constructing Range.","Replace .expect with a proper error so a bad value yields a diagnosable AdapterError instead of a panic."],"exampleFix":"// before\ns.parse::<i64>()\n    .expect(\"Could not parse 'RangePartitioning.Range.Start' as i64\")\n// after\ns.parse::<i64>().map_err(|e| AdapterError::new(\n    AdapterErrorKind::Internal,\n    format!(\"invalid RangePartitioning.Range.Start '{s}': {e}\")))?","handlingStrategy":"validation","validationCode":"fn valid_range_start(meta: &HashMap<String, String>) -> bool {\n    meta.get(\"RangePartitioning.Range.Start\")\n        .map(|s| s.trim().parse::<i64>().is_ok())\n        .unwrap_or(true)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate range metadata values parse as i64 before invoking remote-state reconciliation","Emit range bounds as plain base-10 integer strings in any custom driver/middleware","Avoid formatting (thousand separators, decimals) when serializing BigQuery range values","Refresh cached schemas from the API after adapter upgrades"],"tags":["bigquery","metadata","parsing","panic"],"backgroundTag":"invalid-argument-format","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}