databricks / dbt-databricks

A dbt adapter for Databricks.
https://databricks.com
Apache License 2.0
226 stars 119 forks source link

Propose fix for connection testing issues in Cloud. #836

Closed VersusFacit closed 4 weeks ago

VersusFacit commented 4 weeks ago

Description

dbt cloud has a feature for testing connections. It and other features are currently failing due to adapter behavior flags not being registered for those runs.

If we look at these lines, we see the use of a flag in the adapter class init. This was par t of #808

    def __init__(self, config: Any, mp_context: SpawnContext) -> None:
        super().__init__(config, mp_context)
        if self.behavior.use_info_schema_for_columns.no_warn:  # type: ignore[attr-defined]
            self.get_column_behavior = GetColumnsByInformationSchema()
        else:
            self.get_column_behavior = GetColumnsByDescribe()

This is not guaranteed to succeed. So we can use exception handling to ensure the control flow for other subtasks where the flags won't be registered are handled gracefully.

Checklist