Fix mgp.py create edge type hint and comment (#724)
This commit is contained in:
parent
e5e37bc14a
commit
d72e7fa38d
@ -1283,7 +1283,7 @@ class Graph:
|
|||||||
raise InvalidContextError()
|
raise InvalidContextError()
|
||||||
self._graph.detach_delete_vertex(vertex._vertex)
|
self._graph.detach_delete_vertex(vertex._vertex)
|
||||||
|
|
||||||
def create_edge(self, from_vertex: Vertex, to_vertex: Vertex, edge_type: EdgeType) -> None:
|
def create_edge(self, from_vertex: Vertex, to_vertex: Vertex, edge_type: EdgeType) -> Edge:
|
||||||
"""
|
"""
|
||||||
Create an edge.
|
Create an edge.
|
||||||
|
|
||||||
@ -1292,13 +1292,16 @@ class Graph:
|
|||||||
to_vertex: `Vertex' to where edge is directed.
|
to_vertex: `Vertex' to where edge is directed.
|
||||||
edge_type: `EdgeType` defines the type of edge.
|
edge_type: `EdgeType` defines the type of edge.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Created `Edge`.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ImmutableObjectError: If `graph` is immutable.
|
ImmutableObjectError: If `graph` is immutable.
|
||||||
UnableToAllocateError: If unable to allocate an edge.
|
UnableToAllocateError: If unable to allocate an edge.
|
||||||
DeletedObjectError: If `from_vertex` or `to_vertex` has been deleted.
|
DeletedObjectError: If `from_vertex` or `to_vertex` has been deleted.
|
||||||
SerializationError: If `from_vertex` or `to_vertex` has been modified by another transaction.
|
SerializationError: If `from_vertex` or `to_vertex` has been modified by another transaction.
|
||||||
Examples:
|
Examples:
|
||||||
```graph.create_edge(from_vertex, vertex, edge_type)```
|
```edge = graph.create_edge(from_vertex, vertex, edge_type)```
|
||||||
"""
|
"""
|
||||||
if not self.is_valid():
|
if not self.is_valid():
|
||||||
raise InvalidContextError()
|
raise InvalidContextError()
|
||||||
|
Loading…
Reference in New Issue
Block a user