{"record":{"id":"fc2eeeaf8f3fc55b","repo":"dbt-labs/dbt-core","slug":"failed-to-convert-quoting-to-resolved-quoting","errorCode":null,"errorMessage":"Failed to convert quoting to resolved quoting","messagePattern":"Failed to convert quoting to resolved quoting","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-jinja-utils/src/phases/parse/resolve_model_context.rs","lineNumber":91,"sourceCode":"    sql_resources: Arc<Mutex<Vec<SqlResource<T>>>>,\n    execute_exists: Arc<AtomicBool>,\n    display_path: &Path,\n    model_path: &Path,\n    global_static_analysis: Option<StaticAnalysisKind>,\n) -> BTreeMap<String, MinijinjaValue> {\n    // Create a relation for 'this' using config values\n    let sql_resources_clone = sql_resources.clone();\n    let this_relation = ResolveThisFunction {\n        relation: dbt_adapter::relation::RelationObject::new(Arc::from(\n            dbt_adapter::relation::do_create_relation(\n                adapter_type,\n                database.to_string(),\n                schema.to_string(),\n                Some(model_name.to_string()),\n                None,\n                package_quoting\n                    .try_into()\n                    .expect(\"Failed to convert quoting to resolved quoting\"),\n            )\n            .unwrap(),\n        ))\n        .into_value(),\n        sql_resources: sql_resources_clone,\n    };\n    let this_value = MinijinjaValue::from_object(this_relation);\n\n    // Create a BTreeMap for builtins\n    let mut builtins = BTreeMap::new();\n\n    // Create ref function\n    let sql_resources_clone = sql_resources.clone();\n    let ref_function = ResolveRefFunction {\n        database: database.to_string(),\n        schema: schema.to_string(),\n        adapter_type,\n        sql_resources: sql_resources_clone,","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-jinja-utils/src/phases/parse/resolve_model_context.rs#L73-L109","documentation":"In the `this` function resolver for parse-time model contexts, the package-level quoting config is converted into a resolved `Quoting` via `try_into()` and unwrapped with `expect`. The panic fires when the stored quoting value cannot be represented as a fully resolved quoting (e.g. it is null/undefined where a concrete bool is required). It means the relation cannot be rendered because quoting policy is not resolvable.","triggerScenarios":"Resolving `{{ this }}` in a model whose target or package quoting config contains unresolved/None fields (e.g. `quoting: {database: null, schema: null}` in dbt_project.yml, or a target without quoting defaults applied).","commonSituations":"dbt_project.yml quoting keys set to null instead of true/false; custom targets lacking quoting resolution; adapter profiles where quoting defaults were never merged before parse.","solutions":["Replace null quoting values in dbt_project.yml `quoting:` with explicit true/false (or remove the keys to use defaults)","Check your profile/target that quoting is fully resolved before parse (run `dbt debug` to inspect the resolved target)","At the code level, merge defaults so `package_quoting` is always a resolved Quoting before calling `.try_into()`","Report/patch: turn the expect into a proper error reporting which quoting field was unresolved"],"exampleFix":"// before (dbt_project.yml)\nquoting:\n  database: null\n  schema: null\n  identifier: true\n// after\nquoting:\n  database: true\n  schema: true\n  identifier: true","handlingStrategy":"validation","validationCode":"# dbt_project.yml quoting must be fully concrete before parse\n# quick check:\ngrep -n \"null\" dbt_project.yml  # ensure no quoting: <key>: null\n# or in Rust:\nlet resolved: Option<Quoting> = package_quoting.clone().try_into().ok();\nassert!(resolved.is_some(), \"quoting not resolved\");","typeGuard":"fn quoting_is_resolved(q: &serde_yaml::Value) -> bool {\n    [\"database\", \"schema\", \"identifier\"].iter().all(|k| {\n        q.get(k).map_or(true, |v| v.is_bool())\n    })\n}","tryCatchPattern":"package_quoting.clone().try_into().map_err(|e|\n    anyhow!(\"quoting not resolvable for {{ this }}: {e}\"))?","preventionTips":["Use explicit true/false (or omit keys) for quoting in dbt_project.yml","Run `dbt debug` to confirm the resolved target's quoting","Merge quoting defaults at profile load time","Avoid `null` values in quoting blocks entirely"],"tags":["panic","quoting","relation","jinja","parse"],"backgroundTag":"invalid-config-value","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"}