{"record":{"id":"13801a93fca41294","repo":"dbt-labs/dbt-core","slug":"get-partitions-metadata","errorCode":null,"errorMessage":"get_partitions_metadata","messagePattern":"get_partitions_metadata","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/adapter_impl.rs","lineNumber":702,"sourceCode":"            .map(|pair| {\n                let key = pair.split('=').next().unwrap_or(\"\").trim();\n                format!(\"{key} = '[REDACTED]'\")\n            })\n            .collect::<Vec<_>>()\n            .join(\", \");\n\n        let redacted_sql = sql.replacen(full_parens, &format!(\"({redacted_pairs})\"), 1);\n\n        Ok(redacted_sql)\n    }\n\n    /// BaseAdapter https://github.com/dbt-labs/dbt-adapters/blob/0efd8d3d1081e1ab43e38797d5104f7b424a6284/dbt-adapters/src/dbt/adapters/base/impl.py#L505\n    pub fn get_partitions_metadata(\n        &self,\n        _state: &State,\n        _relation: &dyn BaseRelation,\n    ) -> Result<Value, minijinja::Error> {\n        unimplemented!(\"get_partitions_metadata\")\n    }\n\n    /// Borrow the current thread-local connection or create one if it's not set yet.\n    ///\n    /// A guard is returned. When destroyed, the guard returns the connection to\n    /// the thread-local variable. If another connection became the thread-local\n    /// in the mean time, that connection is dropped and the return proceeds as\n    /// normal.\n    pub fn borrow_tlocal_connection(\n        &self,\n        state: Option<&State>,\n        node_id: Option<String>,\n    ) -> Result<ConnectionGuard<'_>, AdapterError> {\n        borrow_tlocal_connection(self.engine().as_ref(), state, node_id)\n    }\n\n    /// Helper method for execute\n    #[allow(clippy::too_many_arguments)]","sourceCodeStart":684,"sourceCodeEnd":720,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/adapter_impl.rs#L684-L720","documentation":"get_partitions_metadata is a stub that unconditionally panics with unimplemented!. In upstream dbt-adapters (BaseAdapter impl.py), this API returns partition metadata for a relation, but the Rust port has not implemented it for any adapter. Any call immediately aborts the thread.","triggerScenarios":"Invoking AdapterImpl::get_partitions_metadata(&state, &relation) from Jinja templates or adapter-dispatched code, e.g. when a model or macro queries partition metadata of a table.","commonSituations":"Porting macros that rely on the Python BaseAdapter get_partitions_metadata hook; running dbt projects whose macros inspect table partitions.","solutions":["Remove or guard calls to get_partitions_metadata in custom macros until the hook is implemented.","Implement the method in adapter_impl.rs (line ~702) returning partition metadata via the adapter's information_schema queries.","Wrap the call site in catch_unwind or an adapter-level capability check so projects degrade gracefully."],"exampleFix":"// before\npub fn get_partitions_metadata(&self, _state: &State, _relation: &dyn BaseRelation) -> Result<Value, minijinja::Error> {\n    unimplemented!(\"get_partitions_metadata\")\n}\n// after\npub fn get_partitions_metadata(&self, _state: &State, _relation: &dyn BaseRelation) -> Result<Value, minijinja::Error> {\n    Err(minijinja::Error::new(\n        minijinja::ErrorKind::InvalidOperation,\n        \"get_partitions_metadata is not supported by this adapter\",\n    ))\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn has_partitions_metadata_hook(adapter_type: &str) -> bool { /* false until the hook is implemented */ false }","tryCatchPattern":"match std::panic::catch_unwind(|| adapter.get_partitions_metadata(&state, relation)) {\n    Ok(v) => v,\n    Err(_) => default_partition_metadata(),\n}","preventionTips":["Avoid custom macros that call get_partitions_metadata in the Rust engine","Feature-detect adapter hooks before invoking them","Track the upstream port status of BaseAdapter hooks before relying on them"],"tags":["rust","adapter","partitions","metadata","unimplemented"],"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-17T15:17:12.973Z"}