{"record":{"id":"167fa25c039ea856","repo":"dbt-labs/dbt-core","slug":"name-attribute-must-be-a-string","errorCode":null,"errorMessage":"name attribute must be a string","messagePattern":"name attribute must be a string","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-schemas/src/schemas/manifest/bigquery_partition.rs","lineNumber":189,"sourceCode":"    }\n\n    pub fn reject_partition_field_column(\n        &self,\n        args: &[MinijinjaValue],\n    ) -> Result<MinijinjaValue, MinijinjaError> {\n        let mut parser = ArgParser::new(args, None);\n        parser.check_num_args(current_function_name!(), 0, 1)?;\n\n        let columns = parser.get::<MinijinjaValue>(\"columns\")?;\n        if let Ok(iter) = columns.try_iter() {\n            let columns = iter\n                .filter(|c| {\n                    let name = c\n                        .get_attr(\"name\")\n                        .expect(\"column must have a name attribute\");\n                    !name\n                        .as_str()\n                        .expect(\"name attribute must be a string\")\n                        .eq_ignore_ascii_case(self.field.as_str())\n                })\n                .collect::<Vec<_>>();\n            Ok(MinijinjaValue::from(columns))\n        } else {\n            Err(MinijinjaError::new(\n                MinijinjaErrorKind::InvalidArgument,\n                \"columns must be a list of Column\",\n            ))\n        }\n    }\n\n    /// Return true if the data type should be truncated instead of cast to the data type\n    pub fn data_type_should_be_truncated(&self) -> bool {\n        !(self.data_type == \"int64\"\n            || (self.data_type == \"date\"\n                && match &self.__inner__ {\n                    BigqueryPartitionConfigInner::Time(TimeConfig { granularity, .. }) => {","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-schemas/src/schemas/manifest/bigquery_partition.rs#L171-L207","documentation":"Immediately after fetching the column `name` attribute, `reject_partition_field_column` asserts it is a string via `name.as_str().expect(\"name attribute must be a string\")`. This panics when a column's `name` attribute exists but is a non-string Minijinja value (number, mapping, sequence). The comparison against the configured partition field requires a string.","triggerScenarios":"Rendering BigQuery partition SQL where a column entry's `name` resolves to a non-string value — e.g. YAML parsed `name: 2024` or `name: [a, b]` as a number/list, or a custom value object whose `name` attr is not stringifiable.","commonSituations":"Unquoted numeric column names in schema YAML (e.g. `name: 123`) that YAML deserializes as integers; generated configs injecting non-string names; adapter-specific column objects with structured name fields.","solutions":["Quote numeric or boolean column names in the model/schema YAML (`name: \"123\"`) so they deserialize as strings","Validate at config-parse time that every column `name` is a string before rendering","In custom adapters/templates, coerce the name with `.to_string()` instead of expecting `as_str()`"],"exampleFix":"// before\n.as_str().expect(\"name attribute must be a string\")\n// after\nmatch name.as_str() {\n    Some(s) => !s.eq_ignore_ascii_case(self.field.as_str()),\n    None => true,\n}","handlingStrategy":"type-guard","validationCode":"// ensure every column name deserialized as a string\nfor col in &model.columns {\n    let name = col.get(\"name\").expect(\"column missing name\");\n    assert!(name.is_string(), \"column name must be a string, got {:?}\", name);\n}","typeGuard":"fn column_name_is_string(col: &MinijinjaValue) -> bool {\n    col.get_attr(\"name\").map(|n| n.as_str().is_some()).unwrap_or(false)\n}","tryCatchPattern":"let ok = std::panic::catch_unwind(|| partition_cfg.render(alias));\nif ok.is_err() { /* fall back to unfiltered columns */ }","preventionTips":["Always quote column names in YAML configs","Coerce names to strings at config-parse time (name.to_string())","Add a schema-level validation step for column name types"],"tags":["bigquery","partitioning","type-mismatch","jinja"],"backgroundTag":"type-mismatch","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"}