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/gsctl.py b/python/graphscope/gsctl/gsctl.py index dec78db1ff60..0adaddbcf26c 100644 --- a/python/graphscope/gsctl/gsctl.py +++ b/python/graphscope/gsctl/gsctl.py @@ -26,11 +26,25 @@ 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: + import graphscope + 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) diff --git a/python/graphscope/gsctl/tests/test_interactive.py b/python/graphscope/gsctl/tests/test_interactive.py index 87035dfd14cd..c6f54a17e75e 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,15 @@ 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" + def teardown_class(self): disconnect_coordinator()