From d349fcb7c378d046d27fad8eb684b3cc24e27cfc Mon Sep 17 00:00:00 2001 From: zhanglei1949 Date: Fri, 7 Jun 2024 08:21:40 +0000 Subject: [PATCH 1/4] Fix parsing empty edge_type list when creation graph --- flex/storages/rt_mutable_graph/schema.cc | 4 ++ .../gsctl/tests/test_interactive.py | 39 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/flex/storages/rt_mutable_graph/schema.cc b/flex/storages/rt_mutable_graph/schema.cc index 4d3ab9a82a4d..01620ff833cc 100644 --- a/flex/storages/rt_mutable_graph/schema.cc +++ b/flex/storages/rt_mutable_graph/schema.cc @@ -969,6 +969,10 @@ static Status parse_edge_schema(YAML::Node node, Schema& schema) { } static Status parse_edges_schema(YAML::Node node, Schema& schema) { + if (node.IsNull()){ + LOG(INFO) << "No edge is set"; + return Status::OK(); + } if (!node.IsSequence()) { LOG(ERROR) << "edge is not set properly"; return Status(StatusCode::InvalidSchema, "edge is not set properly"); diff --git a/python/graphscope/gsctl/tests/test_interactive.py b/python/graphscope/gsctl/tests/test_interactive.py index 87035dfd14cd..35d72774ec1c 100644 --- a/python/graphscope/gsctl/tests/test_interactive.py +++ b/python/graphscope/gsctl/tests/test_interactive.py @@ -97,6 +97,34 @@ }, } +modern_graph_vertex_only = { + "name": "modern_graph", + "description": "This is a test graph, only contains vertex", + "schema": { + "vertex_types": [ + { + "type_name": "person", + "properties": [ + { + "property_name": "id", + "property_type": {"primitive_type": "DT_SIGNED_INT64"}, + }, + { + "property_name": "name", + "property_type": {"string": {"long_text": ""}}, + }, + { + "property_name": "age", + "property_type": {"primitive_type": "DT_SIGNED_INT32"}, + }, + ], + "primary_keys": ["id"], + } + ], + "edge_types": [], + }, +} + modern_graph_datasource = { "vertex_mappings": [ @@ -355,5 +383,16 @@ def test_suit_case(self): assert stored_procedure_id == "procedure_name" delete_graph_by_id(graph_id_2) + def test_start_service_on_vertex_only_graph(self): + graph_id = create_graph(modern_graph_vertex_only) + start_service(graph_id) + status = list_service_status() + for s in status: + if s.graph_id == graph_id: + assert s.status == "Running" + else: + assert s.status == "Stopped" + delete_graph_by_id(graph_id) + def teardown_class(self): disconnect_coordinator() From a992ffa36107b4e2b4bbe1edcb689ec57481efd3 Mon Sep 17 00:00:00 2001 From: zhanglei1949 Date: Fri, 7 Jun 2024 08:44:47 +0000 Subject: [PATCH 2/4] fix --- python/graphscope/gsctl/tests/test_interactive.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/graphscope/gsctl/tests/test_interactive.py b/python/graphscope/gsctl/tests/test_interactive.py index 35d72774ec1c..c6f54a17e75e 100644 --- a/python/graphscope/gsctl/tests/test_interactive.py +++ b/python/graphscope/gsctl/tests/test_interactive.py @@ -392,7 +392,6 @@ def test_start_service_on_vertex_only_graph(self): assert s.status == "Running" else: assert s.status == "Stopped" - delete_graph_by_id(graph_id) def teardown_class(self): disconnect_coordinator() From af2d5c03f205cc190fb5d8d69fc7bf96379c1904 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Tue, 11 Jun 2024 14:36:28 +0800 Subject: [PATCH 3/4] Use gsctl as utility tool without graphscope in dockerfiles --- python/graphscope/gsctl/gsctl.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/python/graphscope/gsctl/gsctl.py b/python/graphscope/gsctl/gsctl.py index dec78db1ff60..3fff883dd0d1 100644 --- a/python/graphscope/gsctl/gsctl.py +++ b/python/graphscope/gsctl/gsctl.py @@ -26,11 +26,24 @@ 0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..") ) -from graphscope.gsctl.commands import get_command_collection -from graphscope.gsctl.config import get_current_context +try: + from graphscope.gsctl.commands import get_command_collection + from graphscope.gsctl.config import get_current_context +except ModuleNotFoundError: + # if graphscope is not installed, only basic functions or utilities + # can be used, e.g. install dependencies + graphscope = None def cli(): + if graphscope is None: + sys.path.insert( + 0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "commands") + ) + from dev import cli as dev_cli + + dev_cli() + context = get_current_context() # get the specified commands under the FLEX architecture commands = get_command_collection(context) From 9d4cb905ed79044a17adea9698f96175c3bad1b6 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Tue, 11 Jun 2024 14:43:12 +0800 Subject: [PATCH 4/4] update --- python/graphscope/gsctl/gsctl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/graphscope/gsctl/gsctl.py b/python/graphscope/gsctl/gsctl.py index 3fff883dd0d1..0adaddbcf26c 100644 --- a/python/graphscope/gsctl/gsctl.py +++ b/python/graphscope/gsctl/gsctl.py @@ -27,6 +27,7 @@ ) try: + import graphscope from graphscope.gsctl.commands import get_command_collection from graphscope.gsctl.config import get_current_context except ModuleNotFoundError: