From f2435f41e2b6420756207497db0f0ef16d99b634 Mon Sep 17 00:00:00 2001 From: Ethan Harris Date: Wed, 21 Dec 2022 12:33:41 +0000 Subject: [PATCH] [App] Simplify messaging in cloud dispatch (#16160) --- src/lightning_app/runners/cloud.py | 2 +- src/lightning_app/utilities/cloud.py | 7 +------ tests/tests_app/runners/test_cloud.py | 5 ++--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/lightning_app/runners/cloud.py b/src/lightning_app/runners/cloud.py index 45e64755b634a4..884f8092665826 100644 --- a/src/lightning_app/runners/cloud.py +++ b/src/lightning_app/runners/cloud.py @@ -448,7 +448,7 @@ def dispatch( raise RuntimeError("The source upload url is empty.") if getattr(lightning_app_release, "cluster_id", None): - logger.info(f"Running app on {lightning_app_release.cluster_id}") + print(f"Running app on {lightning_app_release.cluster_id}") # Save the config for re-runs app_config.save_to_dir(root) diff --git a/src/lightning_app/utilities/cloud.py b/src/lightning_app/utilities/cloud.py index 6db634649fdbbe..5fb3cc768a9736 100644 --- a/src/lightning_app/utilities/cloud.py +++ b/src/lightning_app/utilities/cloud.py @@ -1,5 +1,4 @@ import os -import warnings from lightning_cloud.openapi import V1Membership @@ -25,11 +24,7 @@ def _get_project(client: LightningClient, project_id: str = LIGHTNING_CLOUD_PROJ if len(projects.memberships) == 0: raise ValueError("No valid projects found. Please reach out to lightning.ai team to create a project") if len(projects.memberships) > 1: - warnings.warn( - f"It is currently not supported to have multiple projects but " - f"found {len(projects.memberships)} projects." - f" Defaulting to the project {projects.memberships[0].name}" - ) + print(f"Defaulting to the project: {projects.memberships[0].name}") return projects.memberships[0] diff --git a/tests/tests_app/runners/test_cloud.py b/tests/tests_app/runners/test_cloud.py index dfae07b6954e29..8ea068fc0992cd 100644 --- a/tests/tests_app/runners/test_cloud.py +++ b/tests/tests_app/runners/test_cloud.py @@ -1383,9 +1383,8 @@ def test_get_project(monkeypatch): V1Membership(name="test-project2", project_id="test-project-id2"), ] ) - with pytest.warns(UserWarning, match="Defaulting to the project test-project1"): - ret = _get_project(mock_client) - assert ret.project_id == "test-project-id1" + ret = _get_project(mock_client) + assert ret.project_id == "test-project-id1" def write_file_of_size(path, size):