Skip to content

Commit d6ae8b0

Browse files
Fix linter errors (#52)
1 parent cdfe6fa commit d6ae8b0

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

redisgraph_bulk_loader/bulk_insert.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def process_entities(entities):
4040
entity.query_buffer.buffer_size += added_size
4141

4242

43+
################################################################################
44+
# Bulk loader
45+
################################################################################
4346
# Command-line arguments
4447
@click.command()
4548
@click.argument('graph')
@@ -124,27 +127,28 @@ def bulk_insert(graph, host, port, password, unix_socket_path, nodes, nodes_with
124127
# Add in Graph Indices after graph creation
125128
for i in index:
126129
l, p = i.split(":")
127-
print("Creating Index on Label: %s, Property: %s" %(l, p))
130+
print("Creating Index on Label: %s, Property: %s" % (l, p))
128131
try:
129-
index_create = client.execute_command("GRAPH.QUERY", graph, "CREATE INDEX ON :%s(%s)" %(l, p))
132+
index_create = client.execute_command("GRAPH.QUERY", graph, "CREATE INDEX ON :%s(%s)" % (l, p))
130133
for z in index_create:
131-
print(z[0].decode("utf-8") )
134+
print(z[0].decode("utf-8"))
132135
except redis.exceptions.ResponseError as e:
133-
print("Unable to create Index on Label: %s, Property %s" %(l, p))
136+
print("Unable to create Index on Label: %s, Property %s" % (l, p))
134137
print(e)
135138

136139
# Add in Full Text Search Indices after graph creation
137140
for i in full_text_index:
138141
l, p = i.split(":")
139-
print("Creating Full Text Search Index on Label: %s, Property: %s" %(l, p))
142+
print("Creating Full Text Search Index on Label: %s, Property: %s" % (l, p))
140143
try:
141-
index_create = client.execute_command("GRAPH.QUERY", graph, "CALL db.idx.fulltext.createNodeIndex('%s', '%s')" %(l, p))
144+
index_create = client.execute_command("GRAPH.QUERY", graph, "CALL db.idx.fulltext.createNodeIndex('%s', '%s')" % (l, p))
142145
print(index_create[-1][0].decode("utf-8"))
143146
except redis.exceptions.ResponseError as e:
144-
print("Unable to create Full Text Search Index on Label: %s, Property %s" %(l, p))
147+
print("Unable to create Full Text Search Index on Label: %s, Property %s" % (l, p))
145148
print(e)
146149
except:
147-
print("Unknown Error: Unable to create Full Text Search Index on Label: %s, Property %s" %(l, p))
150+
print("Unknown Error: Unable to create Full Text Search Index on Label: %s, Property %s" % (l, p))
151+
148152

149153
if __name__ == '__main__':
150154
bulk_insert()

redisgraph_bulk_loader/entity_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def typed_prop_to_binary(prop_val, prop_type):
9494
else:
9595
raise SchemaError("Could not parse '%s' as a boolean" % prop_val)
9696

97-
elif prop_type== Type.ID or prop_type == Type.STRING:
97+
elif prop_type == Type.ID or prop_type == Type.STRING:
9898
# If we've reached this point, the property is a string
9999
encoded_str = str.encode(prop_val) # struct.pack requires bytes objects as arguments
100100
# Encoding len+1 adds a null terminator to the string

0 commit comments

Comments
 (0)