{"record":{"id":"f678ce9e3efcdcea","repo":"dbt-labs/dbt-core","slug":"failed-to-parse-value-of-field-as-bool","errorCode":null,"errorMessage":"Failed to parse value of `{field}` as bool.","messagePattern":"Failed to parse value of `(.+?)` as bool\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/dbt-runtime-macros/src/entry.rs","lineNumber":316,"sourceCode":"                format!(\n                    \"Failed to parse value of `{}` as path: \\\"{}\\\"\",\n                    field,\n                    s.value()\n                ),\n            );\n            s.parse::<syn::Path>().map_err(|_| err.clone())\n        }\n        _ => Err(syn::Error::new(\n            span,\n            format!(\"Failed to parse value of `{field}` as path.\"),\n        )),\n    }\n}\n\nfn parse_bool(bool: syn::Lit, span: Span, field: &str) -> Result<bool, syn::Error> {\n    match bool {\n        syn::Lit::Bool(b) => Ok(b.value),\n        _ => Err(syn::Error::new(\n            span,\n            format!(\"Failed to parse value of `{field}` as bool.\"),\n        )),\n    }\n}\n\nfn contains_impl_trait(ty: &syn::Type) -> bool {\n    match ty {\n        syn::Type::ImplTrait(_) => true,\n        syn::Type::Array(t) => contains_impl_trait(&t.elem),\n        syn::Type::Ptr(t) => contains_impl_trait(&t.elem),\n        syn::Type::Reference(t) => contains_impl_trait(&t.elem),\n        syn::Type::Slice(t) => contains_impl_trait(&t.elem),\n        syn::Type::Tuple(t) => t.elems.iter().any(contains_impl_trait),\n        syn::Type::Paren(t) => contains_impl_trait(&t.elem),\n        syn::Type::Group(t) => contains_impl_trait(&t.elem),\n        syn::Type::Path(t) => match t.path.segments.last() {\n            Some(segment) => match &segment.arguments {","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-runtime-macros/src/entry.rs#L298-L334","documentation":"Raised by parse_bool in crates/dbt-runtime-macros/src/entry.rs when a boolean-valued macro attribute option (e.g. `start_paused`) receives a literal that is not a Rust `true`/`false` bool literal. The macro expects `syn::Lit::Bool` and rejects everything else at compile time.","triggerScenarios":"Writing `start_paused = \"true\"` (a string), `start_paused = 1`, or any non-bool literal on an attribute option that parse_bool handles via setters like set_start_paused.","commonSituations":"Quoting a boolean value by habit from config files; using 0/1 integer style; passing a runtime expression instead of a literal (proc-macro attributes only accept literals here).","solutions":["Use an unquoted boolean literal: `start_paused = true` or `start_paused = false`","Remove surrounding quotes if you wrote `\"true\"`","Remember attribute values must be compile-time literals, not runtime expressions"],"exampleFix":"// before\n#[dbt::main(start_paused = \"true\")]\n// after\n#[dbt::main(start_paused = true)]","handlingStrategy":"validation","validationCode":"// boolean attribute options take bare literals, not quoted strings\nfn is_valid_bool_attr(raw: &str) -> bool {\n    raw == \"true\" || raw == \"false\"\n}\n// e.g. attribute should read: start_paused = true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write boolean attribute options without quotes: `= true`, not `= \"true\"`","Never use 0/1 for boolean macro options","Remember proc-macro attribute values are compile-time literals only"],"tags":["proc-macro","rust","attribute","bool","parse-error"],"backgroundTag":"invalid-flag-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"}