Skip to content

Conversation

@benc-db
Copy link
Collaborator

@benc-db benc-db commented Dec 16, 2025

Description

Adds initial implementation of UC metric views as a materialization

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

ericj-db and others added 14 commits September 11, 2025 16:26
### Description

I don't know how this was happening, since the code for change detection
seems to not return a TagsConfig when I go into via debug, but we were
calling alter with an empty set tags set, which was raising exceptions.

### Checklist

- [x] I have run this code in development and it appears to resolve the
stated issue
- [x] This PR includes tests, or tests are not required/relevant for
this PR
- [ ] I have updated the `CHANGELOG.md` and added information about my
change to the "dbt-databricks next" section.
### Description

Migrating to SDK for every REST call

### Checklist

- [x] I have run this code in development and it appears to resolve the
stated issue
- [x] This PR includes tests, or tests are not required/relevant for
this PR
- [x] I have updated the `CHANGELOG.md` and added information about my
change to the "dbt-databricks next" section.

---------

Co-authored-by: Eric Jang <eric.jang@databricks.com>
Resolved merge conflicts and fixed metric view issues:

- tags.sql: Restored metric view handling (ALTER METRIC VIEW is invalid SQL,
  must use ALTER VIEW for metric views)
- replace.sql: Fixed to check target_relation.is_metric_view since metric views
  are stored as VIEW type in information_schema
- metric_view.sql: Simplified to always use CREATE OR REPLACE to avoid type
  mismatch issues between ViewConfig and MetricViewConfig
- relation.py: Merged metric view support with iceberg can_be_replaced support

All unit tests (710) and metric view functional tests (11) pass.
TestDebugMetricViewChanges was a debugging artifact:
- Named 'Debug' indicating temporary purpose
- Functionality already covered by TestMetricViewSimpleChanges
- view_update_via_alter config no longer changes behavior after simplification
@github-actions
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  impl.py 920-926, 937-943, 1159, 1167, 1173-1185
  relation.py 118, 122, 126
  dbt/adapters/databricks/relation_configs
  metric_view.py 29-52
Project Total  

This report was generated by python-coverage-comment-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants