From d2bec3455f79e65b97852ea8783c599480e5d8a7 Mon Sep 17 00:00:00 2001 From: thomas chaton Date: Fri, 4 Nov 2022 13:56:12 +0000 Subject: [PATCH 1/3] update --- src/lightning_app/core/app.py | 2 +- tests/tests_app/core/test_lightning_app.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lightning_app/core/app.py b/src/lightning_app/core/app.py index caa9126b531b0..0ed3ea22bce19 100644 --- a/src/lightning_app/core/app.py +++ b/src/lightning_app/core/app.py @@ -284,7 +284,7 @@ def check_error_queue(self) -> None: @property def flows(self) -> List["LightningFlow"]: """Returns all the flows defined within this application.""" - return list(self.root.flows.values()) + return [self.root] + list(self.root.flows.values()) @property def works(self) -> List[LightningWork]: diff --git a/tests/tests_app/core/test_lightning_app.py b/tests/tests_app/core/test_lightning_app.py index c7fbba6f2ff47..8eee33d4f8f0d 100644 --- a/tests/tests_app/core/test_lightning_app.py +++ b/tests/tests_app/core/test_lightning_app.py @@ -219,6 +219,7 @@ def test_nested_component_names(): def test_get_component_by_name(): app = LightningApp(A()) + assert app.root in app.flows assert app.get_component_by_name("root") is app.root assert app.get_component_by_name("root.b") is app.root.b assert app.get_component_by_name("root.w_a") is app.root.w_a From cc24fd249a965d1c3ee7b509a24c8a2412f1a616 Mon Sep 17 00:00:00 2001 From: thomas chaton Date: Fri, 4 Nov 2022 13:58:49 +0000 Subject: [PATCH 2/3] update --- src/lightning_app/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lightning_app/CHANGELOG.md b/src/lightning_app/CHANGELOG.md index 86a2265bbe9f6..5b9f7a575d08c 100644 --- a/src/lightning_app/CHANGELOG.md +++ b/src/lightning_app/CHANGELOG.md @@ -49,7 +49,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed writing app name and id in connect.txt file for the command CLI ([#15443](https://github.com/Lightning-AI/lightning/pull/15443)) -- +- Fixed missing root flow among the flows of the app ([#15531](https://github.com/Lightning-AI/lightning/pull/15531)) - From c0b5148fab9ce3872b43994f31e0bcdee5f775cd Mon Sep 17 00:00:00 2001 From: thomas chaton Date: Fri, 4 Nov 2022 14:39:08 +0000 Subject: [PATCH 3/3] updatre --- tests/tests_app/utilities/test_load_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tests_app/utilities/test_load_app.py b/tests/tests_app/utilities/test_load_app.py index 2fdba91762f51..a26c622ac2b66 100644 --- a/tests/tests_app/utilities/test_load_app.py +++ b/tests/tests_app/utilities/test_load_app.py @@ -30,6 +30,7 @@ def test_extract_metadata_from_component(): app = load_app_from_file(os.path.join(test_script_dir, "app_metadata.py")) metadata = extract_metadata_from_app(app) assert metadata == [ + {"affiliation": ["root"], "cls_name": "RootFlow", "module": "__main__", "docstring": "RootFlow."}, { "affiliation": ["root", "flow_a_1"], "cls_name": "FlowA", @@ -41,7 +42,7 @@ def test_extract_metadata_from_component(): "cls_name": "WorkA", "module": "__main__", "docstring": "WorkA.", - "local_build_config": {"__build_config__": ANY}, + "local_build_config": {"__build_config__": {"requirements": [], "dockerfile": [], "image": None}}, "cloud_build_config": {"__build_config__": {"requirements": [], "dockerfile": [], "image": None}}, "cloud_compute": { "type": "__cloud_compute__",