Skip to content
Merged
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/lightning_app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

-

Expand Down
2 changes: 1 addition & 1 deletion src/lightning_app/core/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
1 change: 1 addition & 0 deletions tests/tests_app/core/test_lightning_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/tests_app/utilities/test_load_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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__",
Expand Down