Skip to content

Commit

Permalink
more...
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Sep 18, 2024
1 parent 95d9c02 commit 9a818e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/litdata/streaming/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def _resolve_studio(dir_path: str, target_name: Optional[str], target_id: Option
project_id = os.getenv("LIGHTNING_CLOUD_PROJECT_ID", None)

if cluster_id is None:
raise RuntimeError("The `cluster_id` couldn't be found from the environment variables.")
raise RuntimeError("The `LIGHTNING_CLUSTER_ID` couldn't be found from the environment variables.")

if project_id is None:
raise RuntimeError("The `project_id` couldn't be found from the environment variables.")
raise RuntimeError("The `LIGHTNING_CLOUD_PROJECT_ID` couldn't be found from the environment variables.")

clusters = client.cluster_service_list_project_clusters(project_id).clusters

Expand Down Expand Up @@ -147,7 +147,7 @@ def _resolve_s3_connections(dir_path: str) -> Dir:
# Get the ids from env variables
project_id = os.getenv("LIGHTNING_CLOUD_PROJECT_ID", None)
if project_id is None:
raise RuntimeError("The `project_id` couldn't be found from the environment variables.")
raise RuntimeError("The `LIGHTNING_CLOUD_PROJECT_ID` couldn't be found from the environment variables.")

target_name = dir_path.split("/")[3]

Expand Down
2 changes: 1 addition & 1 deletion tests/streaming/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_src_resolver_s3_connections(monkeypatch, lightning_cloud_mock):
auth = login.Auth()
auth.save(user_id="7c8455e3-7c5f-4697-8a6d-105971d6b9bd", api_key="e63fae57-2b50-498b-bc46-d6204cbf330e")

with pytest.raises(RuntimeError, match="`project_id` couldn't be found from the environment variables."):
with pytest.raises(RuntimeError, match="`LIGHTNING_CLOUD_PROJECT_ID` couldn't be found from the environment variables."):
resolver._resolve_dir("/teamspace/s3_connections/imagenet")

monkeypatch.setenv("LIGHTNING_CLOUD_PROJECT_ID", "project_id")
Expand Down

0 comments on commit 9a818e4

Please sign in to comment.