Skip to content

Commit

Permalink
fix(interactive): Check the number of edge properties when creating g…
Browse files Browse the repository at this point in the history
…raph schema (#3916)

Currently we only support edge with only one property.
  • Loading branch information
zhanglei1949 authored Jun 13, 2024
1 parent a46f1fe commit 4e757e0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion flex/storages/rt_mutable_graph/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,17 @@ static Status parse_edge_schema(YAML::Node node, Schema& schema) {
RETURN_IF_NOT_OK(parse_edge_properties(node["properties"], edge_label_name,
property_types, prop_names,
schema.GetVersion()));

// TODO(zhanglei): Remove this check after multiple edge properties are
// supported.
if (property_types.size() > 1) {
LOG(ERROR) << "Currently edge can not have "
"more than one property";
return Status(StatusCode::InvalidSchema,
"Currently edge can not have "
"more than one property");
}

if (node["description"]) {
description = node["description"].as<std::string>();
}
Expand Down Expand Up @@ -969,7 +980,7 @@ static Status parse_edge_schema(YAML::Node node, Schema& schema) {
}

static Status parse_edges_schema(YAML::Node node, Schema& schema) {
if (node.IsNull()){
if (node.IsNull()) {
LOG(INFO) << "No edge is set";
return Status::OK();
}
Expand Down

0 comments on commit 4e757e0

Please sign in to comment.