{"record":{"id":"d21c7d23f3e906bd","repo":"dbt-labs/dbt-core","slug":"unsupported-numeric-type-for-version","errorCode":null,"errorMessage":"unsupported numeric type for version","messagePattern":"unsupported numeric type for version","errorType":"validation","errorClass":"minijinja::Error","httpStatus":null,"severity":"error","filePath":"crates/dbt-schemas/src/schemas/serde.rs","lineNumber":772,"sourceCode":"\n    fn try_from(value: minijinja::Value) -> Result<Self, Self::Error> {\n        match value.kind() {\n            ValueKind::String => Ok(NodeVersion::String(\n                value\n                    .as_str()\n                    .expect(\"kind is String but as_str returned None\")\n                    .to_owned(),\n            )),\n            ValueKind::Number => {\n                if value.is_integer() {\n                    if let Some(i) = value.as_i64() {\n                        return Ok(NodeVersion::Integer(i));\n                    }\n                }\n                if let Ok(f) = f64::try_from(value) {\n                    Ok(NodeVersion::Float(f))\n                } else {\n                    Err(minijinja::Error::new(\n                        minijinja::ErrorKind::InvalidOperation,\n                        \"unsupported numeric type for version\",\n                    ))\n                }\n            }\n            _ => Err(minijinja::Error::new(\n                minijinja::ErrorKind::InvalidOperation,\n                \"version must be a string, integer, or float\",\n            )),\n        }\n    }\n}\n\n#[derive(Debug, Serialize, UntaggedEnumDeserialize, Clone, PartialEq, Eq, DbtSchema)]\n#[serde(untagged)]\npub enum StringOrMap {\n    StringValue(String),\n    MapValue(HashMap<String, YmlValue>),","sourceCodeStart":754,"sourceCodeEnd":790,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-schemas/src/schemas/serde.rs#L754-L790","documentation":"This minijinja error is thrown by NodeVersion's TryFrom<Value> conversion in crates/dbt-schemas/src/schemas/serde.rs. When the version value is numeric, the code first tries integers, then falls back to `f64::try_from(value)`; if neither works (e.g. a numeric type that cannot be represented as f64, such as very large integers), it reports 'unsupported numeric type for version'.","triggerScenarios":"Converting a minijinja Value whose numeric payload cannot be extracted as i64/u64 (that path failed) nor as f64 — e.g. an out-of-range or exotic numeric value assigned to a node's `version` field during deserialization.","commonSituations":"dbt model/resource `version` fields set to extremely large numbers or unusual numeric values in YAML; templated version values producing a numeric type outside supported ranges.","solutions":["Change the version value to a normal integer within i64/u64 range, or a finite float","Quote the version to make it a string, e.g. `version: '2.0'`, which takes the string branch","Inspect the rendered value in your template to confirm what numeric type it produces","Round or clamp oversized numbers in upstream config before they reach serialization"],"exampleFix":"# before\nversion: 99999999999999999999999999\n# after\nversion: '2.0'","handlingStrategy":"type-guard","validationCode":"import math\n\ndef is_safe_numeric_version(v):\n    if isinstance(v, bool):\n        return False\n    if isinstance(v, int):\n        return -(2**63) <= v <= 2**64 - 1\n    if isinstance(v, float):\n        return math.isfinite(v)\n    return False\n# guard before emitting a numeric version into templates","typeGuard":"import math\n\ndef as_node_version(v):\n    if isinstance(v, bool):\n        return None\n    if isinstance(v, int) and -(2**63) <= v <= 2**64 - 1:\n        return v\n    if isinstance(v, float) and math.isfinite(v):\n        return v\n    if isinstance(v, str):\n        return v\n    return None","tryCatchPattern":"try:\n    node_version = NodeVersion.try_from(value)\nexcept Exception:\n    # fall back to a string version, which always converts\n    node_version = NodeVersion.try_from(str(value))","preventionTips":["Keep version values as small integers, finite floats, or strings","Quote versions like '2.0' to force the string branch","Avoid template expressions that emit huge or exotic numeric types"],"tags":["minijinja","serialization","version","numeric"],"backgroundTag":"invalid-argument-value","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"}