-
Notifications
You must be signed in to change notification settings - Fork 49
add support for path type #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request introduces 2 alerts when merging 529502e into 7a70219 - view on LGTM.com new alerts:
|
redisgraph/query_result.py
Outdated
def parse_path(self, cell): | ||
nodes = self.parse_scalar(cell[0]) | ||
relationships = self.parse_scalar(cell[1]) | ||
return Path(nodes, relationships) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert both nodes and relationships types, consider performing the assertion in Path's constructor
This pull request introduces 2 alerts when merging 24abf0a into 7a70219 - view on LGTM.com new alerts:
|
test.py
Outdated
redis_graph.add_edge(edge01) | ||
redis_graph.add_edge(edge12) | ||
|
||
redis_graph.commit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.flush()
redisgraph/path.py
Outdated
@classmethod | ||
def new_path(cls, nodes, edges): | ||
return cls(nodes, edges) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this function, use constructor.
This pull request introduces 2 alerts when merging 229b3d6 into 7a70219 - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
=======================================
Coverage 80.62% 80.62%
=======================================
Files 7 7
Lines 387 387
=======================================
Hits 312 312
Misses 75 75 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a single comment, nothing fancy.
def add_node(self, node): | ||
assert(isinstance(node, self.append_type)) | ||
self.nodes.append(node) | ||
self.append_type = Edge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.append_type = type(Edge)
seems more aligned with the naming.
but then assert(isinstance(node, self.append_type))
should be updated to
assert(type(node) == self.append_type)
redisgraph/path.py
Outdated
return self | ||
|
||
def add_edge(self, edge): | ||
assert(isinstance(edge, self.append_type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment.
This pull request introduces 2 alerts when merging 7db8259 into 7a70219 - view on LGTM.com new alerts:
|
README.md
Outdated
# See path.py for more path API. | ||
print(path.edge_count(), path.nodes_count()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example should print the path, don't refer users to source code within the readme.
README.md
Outdated
# Iterate through resultset | ||
for record in result.result_set: | ||
path = record[0] | ||
# See path.py for more path API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this comment.
This pull request introduces 2 alerts when merging 02710d6 into 7a70219 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging a01df09 into 7a70219 - view on LGTM.com new alerts:
|
No description provided.