{"record":{"id":"155b9f59b4819b0e","repo":"dbt-labs/dbt-core","slug":"relation-creation-from-jinja-values","errorCode":null,"errorMessage":"{} relation creation from Jinja values","messagePattern":"(.+?) relation creation from Jinja values","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/relation_impl.rs","lineNumber":667,"sourceCode":"                .unwrap_or(false),\n            _ => false,\n        }\n    }\n\n    fn has_information(&self) -> bool {\n        self.metadata.is_some()\n    }\n\n    fn as_any(&self) -> &dyn Any {\n        self\n    }\n\n    fn to_owned(&self) -> Arc<dyn BaseRelation> {\n        Arc::new(self.clone())\n    }\n\n    fn create_from(&self) -> Result<Arc<dyn BaseRelation>, minijinja::Error> {\n        unimplemented!(\"{} relation creation from Jinja values\", self.adapter_type)\n    }\n\n    fn database(&self) -> Option<&str> {\n        if self.is_parse_time {\n            return None;\n        }\n\n        self.path.database.as_deref()\n    }\n\n    fn schema(&self) -> Option<&str> {\n        self.path.schema.as_deref()\n    }\n\n    fn identifier(&self) -> Option<&str> {\n        self.path.identifier.as_deref()\n    }\n","sourceCodeStart":649,"sourceCodeEnd":685,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/relation_impl.rs#L649-L685","documentation":"create_from constructs a new BaseRelation from Jinja-provided values (as dbt-core's Relation.create_from does). The default BaseRelation implementation in this codebase is a parse-time stub, so create_from panics with unimplemented!() reporting the adapter type — real relation creation from Jinja values must go through adapter-specific relation classes.","triggerScenarios":"Calling .create_from(...) on a BaseRelation instance from Jinja/macros — e.g. Relation.create_from(database=..., schema=..., identifier=...) — when the backing object is the generic parse-time relation rather than an adapter-specific implementation.","commonSituations":"Macros ported from dbt-core that rely on api.Relation.create_from; custom materializations creating relations at runtime; running at parse time where the generic relation stub is bound instead of the adapter's relation class.","solutions":["Use the adapter-specific relation's create_from (e.g. the adapter's bound Relation class exposed via api.Relation in Jinja) instead of the generic BaseRelation.","Construct the relation directly in Rust with the appropriate fields rather than routing through the Jinja interop method.","Ensure the macro runs in an execution (not parse-only) context where a real adapter relation is bound."],"exampleFix":"// before (Jinja)\n{% set rel = api.Relation.create_from(database=this.database, schema=this.schema, identifier=\"my_table\") %}\n\n// after\n{% set rel = adapter.get_relation(database=this.database, schema=this.schema, identifier=\"my_table\") %}","handlingStrategy":"fallback","validationCode":"{% set rel_class = adapter.Relation if adapter is defined else none %}\n{% if rel_class is none %}{% do exceptions.raise_compiler_error(\"create_from unavailable at parse time\") %}{% endif %}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use adapter.get_relation or the adapter-bound api.Relation class instead of the generic BaseRelation.create_from.","Avoid relation construction in parse-only contexts.","When porting dbt-core macros, replace Relation.create_from with the execution-context equivalent."],"tags":["unimplemented","jinja","relation","base-relation"],"backgroundTag":"method-not-implemented","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"}