dbt-labs/dbt-core · error

parse_index

Error message

parse_index

What it means

parse_index converts a raw index definition (from Postgres CREATE INDEX DDL) into a structured index object; it mirrors PostgresAdapter.impl.py#L128 but is an unimplemented!() stub in this Rust adapter, so any call panics unconditionally, independent of adapter type.

Source

Thrown at crates/dbt-adapter/src/adapter/adapter_impl.rs:4752

        ]))
    }

    /// DatabricksAdapter https://github.com/databricks/dbt-databricks/blob/2f11abb306a400cde32b27891b766bf41a11fb1f/dbt/adapters/databricks/impl.py#L463
    pub fn get_relations_without_caching(
        &self,
        _state: &State,
        _relation: &Arc<dyn BaseRelation>,
    ) -> Result<Value, minijinja::Error> {
        unimplemented!("get_relations_without_caching")
    }

    /// PostgresAdapter https://github.com/dbt-labs/dbt-adapters/blob/0efd8d3d1081e1ab43e38797d5104f7b424a6284/dbt-postgres/src/dbt/adapters/postgres/impl.py#L128
    pub fn parse_index(
        &self,
        _state: &State,
        _raw_index: &Value,
    ) -> Result<Value, minijinja::Error> {
        unimplemented!("parse_index")
    }

    /// DatabricksAdapter https://github.com/databricks/dbt-databricks/blob/2f11abb306a400cde32b27891b766bf41a11fb1f/dbt/adapters/databricks/impl.py#L990
    pub fn get_column_tags_from_model(
        &self,
        model: &dyn InternalDbtNodeAttributes,
    ) -> AdapterResult<Value> {
        use crate::relation::databricks::config::components::ColumnTagsLoader;

        if self.adapter_type() != Databricks {
            return Err(AdapterError::new(
                AdapterErrorKind::Internal,
                "get_column_tags_from_model is a Databricks adapter operation".to_string(),
            ));
        }

        let tags = (&ColumnTagsLoader as &dyn ComponentConfigLoader<DatabricksRelationMetadata>)
            .from_local_config(model)?;

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Avoid paths that call parse_index; manage indexes with explicit post-hook CREATE INDEX statements instead
  2. Use an alternative that returns raw index metadata (e.g. direct catalog queries via run_query)
  3. Implement the stub in crates/dbt-adapter if index parsing is required for your workflow

Example fix

// before
let index = adapter.parse_index(state, raw_index)?;

// after
// parse the index DDL in the macro layer or use post-hooks instead of parse_index
Defensive patterns

Strategy: fallback

Try / catch

// Stub panics for every input; avoid entirely:
// manage indexes via post-hooks (CREATE INDEX ...) instead of parse_index

Prevention

When it happens

Trigger: Any call to adapter.parse_index(state, raw_index) — e.g. from Postgres index-related macros (dbt_postgres materializations that parse existing indexes) — always panics because the method body is only the stub.

Common situations: Running Postgres models whose materialization macros parse existing index DDL; migrating Python dbt-postgres behavior that relied on parse_index; no adapter version currently implements this API.

Related errors


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/0e10ef5db14517cb. Report an issue: GitHub.