dbt-labs/dbt-core · error

DbtSource does not support setting detected_unsafe

Error message

DbtSource does not support setting detected_unsafe

What it means

DbtSource's set_detected_introspection is an intentional hard panic: sources are external tables defined in YAML; there is no compiled/introspectable state to mark as detected-unsafe, so the trait method is unimplemented for this node kind.

Solutions

  1. Filter to model-like nodes before invoking the introspection setter
  2. Restrict the call site to node kinds that actually compile against the warehouse
  3. Return a benign no-op for sources if the API must stay uniform
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/dbt-schemas/src/schemas/nodes.rs:2513 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at crates/dbt-schemas/src/schemas/nodes.rs:2513

                                ),
                                format!(
                                    "{:?} / loaded_at_field={:?}",
                                    &other_source.__source_attr__.freshness,
                                    &other_source.__source_attr__.loaded_at_field
                                ),
                            )),
                        ),
                    ],
                );
            }

            result
        } else {
            false
        }
    }
    fn set_detected_introspection(&mut self, _introspection: IntrospectionKind) {
        panic!("DbtSource does not support setting detected_unsafe");
    }
}

impl InternalDbtNodeAttributes for DbtSource {
    fn search_name(&self) -> String {
        format!(
            "{}.{}",
            self.__source_attr__.source_name, self.__common_attr__.name
        )
    }

    fn selector_string(&self) -> String {
        format!(
            "source:{}.{}.{}",
            self.__common_attr__.package_name,
            self.__source_attr__.source_name,
            self.__common_attr__.name
        )

View on GitHub (pinned to 0267ce9170)