Skip to content

Commit

Permalink
Improve type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana committed Nov 29, 2024
1 parent 13ccc3b commit 206e57d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ray_provider/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ def __init__(

# Create a PR for this
@cached_property
def namespace(self):
def namespace(self) -> str:
if self.ray_cluster_yaml is None:
return self.default_namespace
cluster_spec = self.load_yaml_content(self.ray_cluster_yaml)
return cluster_spec["metadata"].get("namespace") or self.default_namespace

# Create another PR for this
def test_connection(self):
def test_connection(self) -> (bool, str):
job_client = self.ray_client(self.address)

job_id = job_client.submit_job(entrypoint="import ray; ray.init(); print(ray.cluster_resources())")
Expand Down Expand Up @@ -420,7 +420,7 @@ def _create_or_update_cluster(
name: str,
namespace: str,
cluster_spec: dict[str, Any],
) -> None:
) -> str:
"""
Create or update the Ray cluster based on the cluster specification.
Expand Down

0 comments on commit 206e57d

Please sign in to comment.