Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- Expose `job_id`, `job_run_id`, and `task_run_id` from the Databricks Jobs `dbt_task` runtime in `adapter_response`, enabling correlation between dbt runs and Databricks workflow executions via `run_results.json` ([#1451](https://github.com/databricks/dbt-databricks/pull/1451) closes [#722](https://github.com/databricks/dbt-databricks/issues/722))

### Fixes

- Skip `DESCRIBE TABLE EXTENDED ... AS JSON` for foreign/federated tables in `get_columns_in_relation`, avoiding repeated failures and extra latency on those sources ([#1472](https://github.com/databricks/dbt-databricks/pull/1472))

## dbt-databricks 1.12.0 (May 18, 2026)

### Features
Expand Down
1 change: 1 addition & 0 deletions dbt/adapters/databricks/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ def get_columns_in_relation( # type: ignore[override]
# TODO: Replace with streaming table capability check when 17.1 is current version
# for SQL warehouses
or relation.type == DatabricksRelationType.StreamingTable
or relation.is_foreign_table
)
return self.get_column_behavior.get_columns_in_relation(self, relation, use_legacy_logic)

Expand Down
23 changes: 23 additions & 0 deletions tests/unit/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,29 @@ def test_get_columns_materialized_view(self, mock_get_columns, adapter, unity_re
assert result[0].dtype == "string"
assert result[0].comment == "mv col"

@patch(
"dbt.adapters.databricks.behaviors.columns.GetColumnsByDescribe._get_columns_with_comments"
)
def test_get_columns_foreign_table_uses_legacy_logic(
self, mock_get_columns, adapter, unity_relation
):
foreign_relation = DatabricksRelation.create(
database=unity_relation.database,
schema=unity_relation.schema,
identifier=unity_relation.identifier,
type=DatabricksRelationType.Foreign,
)
# Foreign/federated tables don't support AS JSON — always use legacy logic
with patch.object(adapter, "has_capability", return_value=True):
mock_get_columns.return_value = [
{"col_name": "federated_col", "data_type": "string", "comment": ""},
]
result = adapter.get_columns_in_relation(foreign_relation)
mock_get_columns.assert_called_with(adapter, foreign_relation, "get_columns_comments")
assert len(result) == 1
assert result[0].column == "federated_col"
assert result[0].dtype == "string"

@patch(
"dbt.adapters.databricks.behaviors.columns.GetColumnsByDescribe._get_columns_with_comments"
)
Expand Down