Skip to content

Commit

Permalink
Fixed graph schema drop and init error when edge_kinds's src or dst g…
Browse files Browse the repository at this point in the history
…one (#1922)

* Fixed  GraphSchema drop function

* Fixed init error when edge_kinds's src or dst gone
  • Loading branch information
iamdrq committed Aug 3, 2022
1 parent aedbb31 commit 489a077
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/graphscope/framework/graph_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ def _from_store_service(self, graph_def):
edge_kinds[edge_label] = []
edge_kinds[edge_label].append(
(
id_to_label[kind.src_vertex_label_id.id],
id_to_label[kind.dst_vertex_label_id.id],
kind.src_vertex_label,
kind.dst_vertex_label,
)
)
for type_def_pb in graph_def.type_defs:
Expand Down Expand Up @@ -519,11 +519,11 @@ def add_edge_label(self, label, src_label=None, dst_label=None, properties=None)
return self._edge_labels_to_add[-1]

def drop(self, label, src_label=None, dst_label=None):
for item in itertools.chain(self.vertex_labels, self._vertex_labels_to_add):
for item in itertools.chain(self._vertex_labels, self._vertex_labels_to_add):
if label == item.label:
self._vertex_labels_to_drop.append(VertexLabel(label))
return
for item in itertools.chain(self.edge_labels, self._edge_labels_to_add):
for item in itertools.chain(self._edge_labels, self._edge_labels_to_add):
if label == item.label:
label_to_drop = EdgeLabel(label)
if src_label and dst_label:
Expand Down

0 comments on commit 489a077

Please sign in to comment.