{"record":{"id":"d02966a587584112","repo":"dbt-labs/dbt-core","slug":"could-not-parse-rangepartitioning-range-end-as-i","errorCode":null,"errorMessage":"Could not parse 'RangePartitioning.Range.End' as i64","messagePattern":"Could not parse 'RangePartitioning\\.Range\\.End' as i64","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/bigquery/config/components/partition_by.rs","lineNumber":85,"sourceCode":"        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            }),\n            // TODO(serramatutu): how do we determine the value of this?\n            copy_partitions: false,\n        })\n    } else {\n        None\n    };\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/bigquery/config/components/partition_by.rs#L67-L103","documentation":"Same family as the Range.Start case: 'RangePartitioning.Range.End' from the remote schema metadata is parsed as i64 with .expect; a non-integer value panics. BigQuery always reports the range end as an integer, so a parse failure indicates corrupted or foreign metadata.","triggerScenarios":"from_remote_state sees 'RangePartitioning.Range.End' whose value fails i64 parsing (empty, decimal, comma-formatted, or placeholder text).","commonSituations":"Upstream tooling serializing the bound as a float string; stale or hand-edited cached schema metadata; driver/adapter version skew changing how the bound is serialized.","solutions":["Inspect the raw metadata string and fix the producer to emit plain integer text.","Re-fetch schema metadata from the live BigQuery API to overwrite corrupted cache.","Use a tolerant parse (trim, strip separators) if upstream formatting cannot be changed immediately.","Convert the .expect into a mapped AdapterError for a diagnosable failure."],"exampleFix":"// before\ns.parse::<i64>()\n    .expect(\"Could not parse 'RangePartitioning.Range.End' as i64\")\n// after\ns.parse::<i64>().map_err(|e| AdapterError::new(\n    AdapterErrorKind::Internal,\n    format!(\"invalid RangePartitioning.Range.End '{s}': {e}\")))?","handlingStrategy":"validation","validationCode":"fn valid_range_end(meta: &HashMap<String, String>) -> bool {\n    meta.get(\"RangePartitioning.Range.End\")\n        .map(|s| s.trim().parse::<i64>().is_ok())\n        .unwrap_or(true)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-validate all three range metadata values (Start/End/Interval) together before reconciliation","Serialize bounds as plain integers, never floats or formatted strings","Re-fetch metadata from BigQuery after tooling/driver version changes","Convert expects to errors upstream so bad values surface with context"],"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"}