{"record":{"id":"5e2f65e1bfa3a557","repo":"dbt-labs/dbt-core","slug":"owner-key-in-config-meta","errorCode":null,"errorMessage":"owner key in config.meta","messagePattern":"owner key in config\\.meta","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-parser/src/resolve/resolve_macros.rs","lineNumber":949,"sourceCode":"\n        apply_macro_patches(\n            &mut macros,\n            &macro_properties,\n            \"test_pkg\",\n            &jinja_env,\n            &base_ctx,\n            None,\n            false,\n        )?;\n\n        let patched = macros.get(&unique_id).expect(\"macro still present\");\n\n        // config.meta mirrors the patched meta\n        let owner = patched\n            .config\n            .meta\n            .get(\"owner\")\n            .expect(\"owner key in config.meta\");\n        assert_eq!(owner.as_str(), Some(\"alice\"));\n\n        // config.docs mirrors the patched docs (show: false)\n        assert!(\n            !patched.config.docs.show,\n            \"config.docs.show should be false\"\n        );\n\n        Ok(())\n    }\n\n    #[test]\n    fn typecheck_macros_isolates_panic_and_still_populates_other_macros() -> FsResult<()> {\n        use minijinja::compiler::typecheck::FunctionRegistry;\n        use minijinja::machinery::Span as MinijinjaSpan;\n        use minijinja::{Argument, DynTypeObject, Environment, Type, UserDefinedFunctionType};\n\n        fn make_macro(unique_id: &str, sql: &str) -> DbtMacro {","sourceCodeStart":931,"sourceCodeEnd":967,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-parser/src/resolve/resolve_macros.rs#L931-L967","documentation":"Assertion \"owner key in config.meta\" panics when the patched macro's `config.meta` map lacks the \"owner\" key in test_apply_macro_patches_populates_config_meta_and_docs. It verifies that macro patch metadata is merged into the macro's resolved config.meta.","triggerScenarios":"The YAML fixture for the macro patch omits `config: meta: owner: alice`, or apply_macro_patches drops config.meta during merge, causing `.get(\"owner\")` to return None.","commonSituations":"Fixture YAML edited so the meta block moved under a wrong key; a serializer/deserializer change (e.g., MetaValue flattening) stops \"owner\" from round-tripping into config.meta.","solutions":["Verify the fixture YAML declares `config: meta: owner: alice` under the patched macro.","Inspect apply_macro_patches' config-merge step to confirm meta is copied into the macro's config rather than discarded.","Dump `patched.config.meta` in the test to see which keys actually landed."],"exampleFix":"// before\nmacros:\n  - name: my_macro\n    patches:\n// after\nmacros:\n  - name: my_macro\n    config:\n      meta:\n        owner: alice","handlingStrategy":"validation","validationCode":"// validate fixture YAML before running the parser\nassert!(yaml[\"config\"][\"meta\"][\"owner\"].is_some(), \"fixture must set config.meta.owner\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep patch fixtures' config.meta blocks explicit","After meta schema changes, round-trip fixtures through serde in a test","Dump merged config.meta on failure for diagnosis"],"tags":["rust","test-assertion","config","macros"],"backgroundTag":"missing-config-key","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"}