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
5 changes: 4 additions & 1 deletion databricks/sdk/dbutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ def widgets(self):
def _cluster_id(self) -> str:
cluster_id = self._config.cluster_id
if not cluster_id:
message = "cluster_id is required in the configuration"
message = (
"cluster_id is required in the configuration. "
"Set it with Config(cluster_id='...') or the DATABRICKS_CLUSTER_ID environment variable"
)
raise ValueError(self._config.wrap_debug_info(message))
return cluster_id

Expand Down
6 changes: 5 additions & 1 deletion tests/test_dbutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def test_fs_rm(dbutils, mocker):
inner.assert_called_with("a", recursive=False)


@raises("cluster_id is required in the configuration. Config: host=http://localhost, auth_type=noop")
@raises(
"cluster_id is required in the configuration. "
"Set it with Config(cluster_id='...') or the DATABRICKS_CLUSTER_ID environment variable. "
"Config: host=http://localhost, auth_type=noop"
)
def test_fs_mount_without_cluster_fails(dbutils):
dbutils.fs.mount("s3://foo", "bar")

Expand Down