Finalize PyEdgeFromVertex and PyEdgeToVertex implementations

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2693
This commit is contained in:
Ivan Paljak 2020-02-27 16:15:50 +01:00
parent b6b6403b06
commit bb4e747fd3

View File

@ -541,9 +541,8 @@ PyObject *PyEdgeFromVertex(PyEdge *self, PyObject *Py_UNUSED(ignored)) {
CHECK(self->py_graph->graph);
const auto *vertex = mgp_edge_get_from(self->edge);
CHECK(vertex);
// TODO: Wrap mgp_vertex_copy(vertex) into _mgp.Vertex and return it.
PyErr_SetString(PyExc_NotImplementedError, "from_vertex");
return nullptr;
return MakePyVertex(mgp_vertex_copy(vertex, self->py_graph->memory),
self->py_graph);
}
PyObject *PyEdgeToVertex(PyEdge *self, PyObject *Py_UNUSED(ignored)) {
@ -553,9 +552,8 @@ PyObject *PyEdgeToVertex(PyEdge *self, PyObject *Py_UNUSED(ignored)) {
CHECK(self->py_graph->graph);
const auto *vertex = mgp_edge_get_to(self->edge);
CHECK(vertex);
// TODO: Wrap mgp_vertex_copy(vertex) into _mgp.Vertex and return it.
PyErr_SetString(PyExc_NotImplementedError, "to_vertex");
return nullptr;
return MakePyVertex(mgp_vertex_copy(vertex, self->py_graph->memory),
self->py_graph);
}
void PyEdgeDealloc(PyEdge *self) {