{"record":{"id":"60e04437be7df219","repo":"dbt-labs/dbt-core","slug":"could-not-parse-rangepartitioning-range-interval","errorCode":null,"errorMessage":"Could not parse 'RangePartitioning.Range.Interval' as i64","messagePattern":"Could not parse 'RangePartitioning\\.Range\\.Interval' as i64","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/bigquery/config/components/partition_by.rs","lineNumber":92,"sourceCode":"                    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            }),\n            // TODO(serramatutu): how do we determine the value of this?\n            copy_partitions: false,\n        })\n    } else {\n        None\n    };\n\n    let partition_by = time_partition.or(range_partition);\n\n    Ok(new_component(partition_by))\n}\n\nfn from_local_config(\n    relation_config: &dyn InternalDbtNodeAttributes,","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/bigquery/config/components/partition_by.rs#L74-L110","documentation":"'RangePartitioning.Range.Interval' is parsed as i64 with .expect while rebuilding the range partition config; a non-integer interval panics. BigQuery defines the range interval as a positive integer, so a parse failure means the metadata was produced incorrectly somewhere between the API and this code.","triggerScenarios":"from_remote_state encounters 'RangePartitioning.Range.Interval' that fails i64 parsing (empty string, decimal such as '1.0', formatted number, or placeholder).","commonSituations":"Serialization skew between driver versions (float-encoded interval); cached/hand-edited metadata; another tool writing the schema metadata with different types.","solutions":["Inspect and correct the metadata producer to emit the interval as a plain integer string.","Re-fetch table metadata from BigQuery to refresh stale values.","If decimals are possible upstream, parse via f64 and validate integrality before constructing Range.","Replace .expect with an AdapterError-returning path to avoid panics in production."],"exampleFix":"// before\ns.parse::<i64>()\n    .expect(\"Could not parse 'RangePartitioning.Range.Interval' as i64\")\n// after\ns.parse::<i64>().map_err(|e| AdapterError::new(\n    AdapterErrorKind::Internal,\n    format!(\"invalid RangePartitioning.Range.Interval '{s}': {e}\")))?","handlingStrategy":"validation","validationCode":"fn valid_range_interval(meta: &HashMap<String, String>) -> bool {\n    meta.get(\"RangePartitioning.Range.Interval\")\n        .map(|s| s.trim().parse::<i64>().map(|v| v > 0).unwrap_or(false))\n        .unwrap_or(true)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the interval is serialized as a positive integer string","Pre-validate interval alongside Start/End before building RangeConfig","Refresh cached metadata after upgrades to avoid older serialization formats","Replace expects with error propagation in any forked code"],"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-14T11:17:12.474Z"}