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
2 changes: 1 addition & 1 deletion src/databricks/labs/pytester/fixtures/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def create(
}
else:
kwargs["spark_conf"] = {"spark.databricks.cluster.profile": "singleNode", "spark.master": "local[*]"}
kwargs["custom_tags"] = {"ResourceClass": "SingleNode"}
kwargs["custom_tags"] = kwargs.get("custom_tags", {}) | {"ResourceClass": "SingleNode"}
if "instance_pool_id" not in kwargs:
kwargs["node_type_id"] = ws.clusters.select_node_type(local_disk=True, min_memory_gb=16)
if "custom_tags" not in kwargs:
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/fixtures/test_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ def test_cluster(make_cluster, env_or_skip):
logger.info(f"created {make_cluster(single_node=True, instance_pool_id=env_or_skip('TEST_INSTANCE_POOL_ID'))}")


def test_cluster_custom_tags(make_cluster, env_or_skip):
cluster = make_cluster(
single_node=True,
instance_pool_id=env_or_skip('TEST_INSTANCE_POOL_ID'),
tags=[EndpointTagPair(key='my-custom-tag', value='my-custom-tag-value')],
)
cluster_tags = cluster.tags.as_dict()
assert isinstance(cluster_tags, dict)
assert cluster_tags["custom_tags"][1]["key"] == "my-custom-tag"


def test_instance_pool(make_instance_pool):
logger.info(f"created {make_instance_pool()}")

Expand Down
Loading