diff options
author | dvora-h <67596500+dvora-h@users.noreply.github.com> | 2022-02-02 13:26:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 13:26:29 +0200 |
commit | 7ea1bf7593f72b5e23f7e4efc7890faec8a3dde5 (patch) | |
tree | 6087856103619f5260bebc9142e385c5759cba67 /redis/commands/graph | |
parent | 7f7f4f6c85c2d05e1810b512890ec42f64ffa0b3 (diff) | |
download | redis-py-7ea1bf7593f72b5e23f7e4efc7890faec8a3dde5.tar.gz |
Fix naming conventions (#1872)
* fix naming convention
* fix worng changes
Diffstat (limited to 'redis/commands/graph')
-rw-r--r-- | redis/commands/graph/__init__.py | 20 | ||||
-rw-r--r-- | redis/commands/graph/edge.py | 2 | ||||
-rw-r--r-- | redis/commands/graph/node.py | 2 | ||||
-rw-r--r-- | redis/commands/graph/query_result.py | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/redis/commands/graph/__init__.py b/redis/commands/graph/__init__.py index 7b9972a..3736195 100644 --- a/redis/commands/graph/__init__.py +++ b/redis/commands/graph/__init__.py @@ -22,7 +22,7 @@ class Graph(GraphCommands): self.edges = [] self._labels = [] # List of node labels. self._properties = [] # List of properties. - self._relationshipTypes = [] # List of relation types. + self._relationship_types = [] # List of relation types. self.version = 0 # Graph version @property @@ -32,7 +32,7 @@ class Graph(GraphCommands): def _clear_schema(self): self._labels = [] self._properties = [] - self._relationshipTypes = [] + self._relationship_types = [] def _refresh_schema(self): self._clear_schema() @@ -49,15 +49,15 @@ class Graph(GraphCommands): self._labels[i] = l[0] def _refresh_relations(self): - rels = self.relationshipTypes() + rels = self.relationship_types() # Unpack data. - self._relationshipTypes = [None] * len(rels) + self._relationship_types = [None] * len(rels) for i, r in enumerate(rels): - self._relationshipTypes[i] = r[0] + self._relationship_types[i] = r[0] def _refresh_attributes(self): - props = self.propertyKeys() + props = self.property_keys() # Unpack data. self._properties = [None] * len(props) @@ -91,11 +91,11 @@ class Graph(GraphCommands): The index of the relation """ try: - relationship_type = self._relationshipTypes[idx] + relationship_type = self._relationship_types[idx] except IndexError: # Refresh relationship types. self._refresh_relations() - relationship_type = self._relationshipTypes[idx] + relationship_type = self._relationship_types[idx] return relationship_type def get_property(self, idx): @@ -155,8 +155,8 @@ class Graph(GraphCommands): def labels(self): return self.call_procedure("db.labels", read_only=True).result_set - def relationshipTypes(self): + def relationship_types(self): return self.call_procedure("db.relationshipTypes", read_only=True).result_set - def propertyKeys(self): + def property_keys(self): return self.call_procedure("db.propertyKeys", read_only=True).result_set diff --git a/redis/commands/graph/edge.py b/redis/commands/graph/edge.py index b334293..b0141d9 100644 --- a/redis/commands/graph/edge.py +++ b/redis/commands/graph/edge.py @@ -22,7 +22,7 @@ class Edge: self.src_node = src_node self.dest_node = dest_node - def toString(self): + def to_string(self): res = "" if self.properties: props = ",".join( diff --git a/redis/commands/graph/node.py b/redis/commands/graph/node.py index 47e4eeb..c5f8429 100644 --- a/redis/commands/graph/node.py +++ b/redis/commands/graph/node.py @@ -37,7 +37,7 @@ class Node: self.properties = properties or {} - def toString(self): + def to_string(self): res = "" if self.properties: props = ",".join( diff --git a/redis/commands/graph/query_result.py b/redis/commands/graph/query_result.py index e9d9f4d..644ac5a 100644 --- a/redis/commands/graph/query_result.py +++ b/redis/commands/graph/query_result.py @@ -292,9 +292,9 @@ class QueryResult: # record = [] # for idx, cell in enumerate(row): # if type(cell) is Node: - # record.append(cell.toString()) + # record.append(cell.to_string()) # elif type(cell) is Edge: - # record.append(cell.toString()) + # record.append(cell.to_string()) # else: # record.append(cell) # tbl.add_row(record) |