Skip to content

feat: Add instrumentation for recording add_query, get_relation_config, is_uniform, has_dbr_capability, and is_cluster methods#1508

Merged
sd-db merged 13 commits into
databricks:mainfrom
dbt-labs:ajhlee/record-adapter-methods
Jul 9, 2026
Merged

feat: Add instrumentation for recording add_query, get_relation_config, is_uniform, has_dbr_capability, and is_cluster methods#1508
sd-db merged 13 commits into
databricks:mainfrom
dbt-labs:ajhlee/record-adapter-methods

Conversation

@ajhlee-dbt

Copy link
Copy Markdown
Contributor

Resolves #N/A.

Description

Instruments the following adapter functions for recording:

  • has_dbr_capability and is_cluster (via the auto record decorator)
  • add_query
  • get_relation_config
  • is_uniform

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.

ajhlee-dbt and others added 6 commits June 12, 2026 02:18
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
…tion

Annotate the new record dataclass methods (_to_dict, __init__, _from_dict)
to satisfy mypy no-untyped-def, and apply ruff import ordering.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
@ajhlee-dbt ajhlee-dbt force-pushed the ajhlee/record-adapter-methods branch from 1d3c89c to 1528a6a Compare June 12, 2026 06:18
@ajhlee-dbt ajhlee-dbt marked this pull request as ready for review June 12, 2026 06:18
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
@databricks databricks deleted a comment from github-actions Bot Jun 23, 2026
@databricks databricks deleted a comment from github-actions Bot Jun 23, 2026
@ajhlee-dbt ajhlee-dbt changed the title Add instrumentation for recording add_query, get_relation_config, is_uniform, has_dbr_capability, and is_cluster methods feat: Add instrumentation for recording add_query, get_relation_config, is_uniform, has_dbr_capability, and is_cluster methods Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  impl.py 338
  dbt/adapters/databricks/record
  record_types.py 22-24, 136, 140
Project Total  

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

@hope-wat

hope-wat commented Jul 6, 2026

Copy link
Copy Markdown

@sd-db @jprakash-db let's get review on this -- @ajhlee-dbt touched up the PR to address the small failing stylistic checks



@Recorder.register_record_type
class DatabricksAdapterAddQueryRecord(Record):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intended record/replay feature for the classes (DatabricksAdapterAddQueryRecord/DatabricksAdapterGetRelationConfigParams/DatabricksAdapterGetRelationConfigRecord). Is there some way we can add tests to check on the roundtrip behaviour.

Mostly I am interested in how serde works here and if the sterialisation logic is correct. Overall would recommend to add unit tests for all the classes to be sure

@hope-wat

hope-wat commented Jul 7, 2026

Copy link
Copy Markdown

As discussed - @ajhlee-dbt is spiking on adding unit tests by end of day 7/7/2026 otherwise we'll pull in for the next release. :D

Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
Signed-off-by: Anna Lee <anna.lee@dbtlabs.com>
@ajhlee-dbt ajhlee-dbt force-pushed the ajhlee/record-adapter-methods branch from 1f661b1 to 8c0f0bb Compare July 8, 2026 14:28
@sd-db

sd-db commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

/integration-test min-deps

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Min-deps integration tests dispatched for PR #1508 by @sd-db. Track progress in the Actions tab.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Min-deps integration results for PR #1508 — UC cluster ✅ success · SQL warehouse ❌ failure · All-purpose cluster ✅ success · Shard coverage ✅ success

Run details.

@sd-db

sd-db commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

/integration-test

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Integration tests dispatched for PR #1508 by @sd-db. Track progress in the Actions tab.

@sd-db

sd-db commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

min-deps failure is due an issue already present in trunk, will be fixed in #1579. Can be ignored.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Integration results for PR #1508 — UC cluster ❌ failure · SQL warehouse ✅ success · All-purpose cluster ❌ failure · Shard coverage ✅ success

Run details.

@databricks databricks deleted a comment from github-actions Bot Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Integration results for PR #1508 — UC cluster ✅ success · SQL warehouse ✅ success · All-purpose cluster ✅ success · Shard coverage ✅ success

Run details.

@sd-db sd-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, thx for the PR !!

@sd-db sd-db merged commit e318a44 into databricks:main Jul 9, 2026
9 checks passed
sd-db added a commit that referenced this pull request Jul 9, 2026
## Summary

Release prep for **dbt-databricks 1.12.2**. Touches only the two release
files:

- `CHANGELOG.md` — set the `1.12.2` heading date to `Jul 9, 2026` and
finalize the section (conformance cleanup + newly-added entries; see
below).
- `dbt/adapters/databricks/__version__.py` — bump `1.12.1` → `1.12.2`.

## CHANGELOG changes in this PR

- **Add `#1508`** (Under the Hood): record/replay instrumentation for
`add_query`, `get_relation_config`, `is_uniform`, `has_dbr_capability`,
`is_cluster` (test-only, no runtime impact).
- **Consolidate the coverage-run test work** into a single
Under-the-Hood entry spanning the release's ~38 test/CI PRs, replacing
the several partial test lines that were scattered across the section.
The `#1576` kernel integration-test workflow line is kept separate (tied
to the kernel feature).
- **Conformance pass** per `AGENTS.md`: fix bare PR links
(`[1440]`/`[1467]`/`[1539]` → `[#…]`), normalize `partially solves` →
`partially resolves` and `closes` → `resolves` on the touched entries.

## Test plan

- [x] `hatch run code-quality` — ruff / ruff format / mypy pass.
(`uv-lock --check` is a known local-config false-negative; this PR does
not touch `pyproject.toml` / `uv.lock`.)
- [x] `hatch run unit` — 1258 passed, 6 skipped, 0 failures.
- [x] `hatch run pre-commit run --files CHANGELOG.md
dbt/adapters/databricks/__version__.py` — pass.
- [x] CI (code quality, unit 3.10–3.13, build) to run on this PR.
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.

[Feature] Instrument conformance in dbt-databricks for eligibility telemetry from core v1 to v2 upgrades

3 participants