Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(interactive): Fix parsing empty edge_type list when creation graph #3902

Merged
merged 6 commits into from
Jun 12, 2024
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
4 changes: 4 additions & 0 deletions flex/storages/rt_mutable_graph/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
18 changes: 16 additions & 2 deletions python/graphscope/gsctl/gsctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
38 changes: 38 additions & 0 deletions python/graphscope/gsctl/tests/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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()
Loading