Skip to content
12 changes: 12 additions & 0 deletions redis/commands/graph/query_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
from .path import Path

LABELS_ADDED = "Labels added"
LABELS_REMOVED = "Labels removed"
NODES_CREATED = "Nodes created"
NODES_DELETED = "Nodes deleted"
RELATIONSHIPS_DELETED = "Relationships deleted"
PROPERTIES_SET = "Properties set"
PROPERTIES_REMOVED = "Properties removed"
RELATIONSHIPS_CREATED = "Relationships created"
INDICES_CREATED = "Indices created"
INDICES_DELETED = "Indices deleted"
Expand All @@ -21,8 +23,10 @@

STATS = [
LABELS_ADDED,
LABELS_REMOVED,
NODES_CREATED,
PROPERTIES_SET,
PROPERTIES_REMOVED,
RELATIONSHIPS_CREATED,
NODES_DELETED,
RELATIONSHIPS_DELETED,
Expand Down Expand Up @@ -325,6 +329,10 @@ def _get_stat(self, stat):
def labels_added(self):
return self._get_stat(LABELS_ADDED)

@property
def labels_removed(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add docstrings to each of these

return self._get_stat(LABELS_REMOVED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though they're "gimmes" we should have unit tests, covering each property - this way we don't break them in the future.


@property
def nodes_created(self):
return self._get_stat(NODES_CREATED)
Expand All @@ -337,6 +345,10 @@ def nodes_deleted(self):
def properties_set(self):
return self._get_stat(PROPERTIES_SET)

@property
def properties_removed(self):
return self._get_stat(PROPERTIES_REMOVED)

@property
def relationships_created(self):
return self._get_stat(RELATIONSHIPS_CREATED)
Expand Down