Skip to content

fix(databricks): use UC-compatible access mode when job paths resolve to Volumes - #227

Open
jtdossett wants to merge 1 commit into
mainfrom
feat/217-databricks-uc-cluster-access-mode
Open

fix(databricks): use UC-compatible access mode when job paths resolve to Volumes#227
jtdossett wants to merge 1 commit into
mainfrom
feat/217-databricks-uc-cluster-access-mode

Conversation

@jtdossett

Copy link
Copy Markdown
Collaborator

Summary

  • Databricks job clusters now switch to SINGLE_USER data security mode whenever a job's artifacts_storage_path or resolved python_file points into a Unity Catalog Volumes path (/Volumes/...), matching what UC Volumes access actually requires.
  • python_file resolution now happens before cluster_spec construction so the Volumes check can see the final path.
  • spark.databricks.cluster.profile is now popped whenever UC mode is needed (previously only when a log volume was set), since the incompatibility applies whenever SINGLE_USER is set.

Test plan

  • poe test-unit — 2341 passed, 2 skipped
  • 5 new unit tests: path predicate, artifacts_storage_path volume case, explicit python_file override, classic bootstrap_script_root (regression), existing_cluster_id-harmless case
  • Internal reviewer verified diff against DESIGN — APPROVE, no blockers

Closes #217

🤖 Generated with Claude Code

… to Volumes

_build_job_spec only set data_security_mode=SINGLE_USER when the opt-in
cluster_logs_volume was provided. Any other new-cluster submission whose
artifacts_storage_path or python_file resolved to /Volumes/... still got
Databricks' default "No Isolation Shared" cluster, which cannot read
Unity Catalog Volumes regardless of grants.

Detect the need for UC-compatible access mode from the shape of the
resolved paths instead: add _is_uc_volume_path (mirrors the existing
check in artifact_store.py and bootstrap.py), resolve python_file before
the cluster_spec is built so it can be inspected, and gate
data_security_mode / the spark.databricks.cluster.profile strip on
needs_uc_mode rather than only the cluster_logs_volume branch.
cluster_log_conf (log delivery) stays a separate, still-opt-in decision.

Fixes gh#217
Copilot AI review requested due to automatic review settings July 30, 2026 04:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Databricks job submission when the job’s resolved paths land in Unity Catalog Volumes (/Volumes/...) by ensuring new job clusters are created with a UC-compatible access mode (data_security_mode=SINGLE_USER) whenever the resolved artifacts_storage_path or python_file points into Volumes.

Changes:

  • Add a /Volumes path predicate and use it to drive SINGLE_USER selection (not just the cluster_logs_volume opt-in).
  • Resolve python_file before building the cluster spec so UC-mode detection can use the final resolved path; broaden popping of spark.databricks.cluster.profile whenever UC mode is required.
  • Add unit tests covering the new UC Volumes detection cases and document the fix in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/kindling_sdk/kindling_sdk/platform_databricks.py Detects UC Volumes paths and sets SINGLE_USER for new clusters when resolved job paths point into /Volumes/...; resolves python_file earlier to support that detection.
tests/unit/test_platform_databricks_sdk_job_config.py Adds unit tests for the Volumes-path predicate and for UC-mode selection driven by resolved artifacts_storage_path/python_file.
CHANGELOG.md Adds an Unreleased entry documenting the Databricks UC Volumes access-mode fix (gh#217).

return "/".join([root.rstrip("/"), *cleaned_parts])

@staticmethod
def _is_uc_volume_path(path: str) -> bool:
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.

[Bug] Databricks job clusters default to non-UC access mode, cannot read python_file from Volumes

2 participants