-
Notifications
You must be signed in to change notification settings - Fork 54
Support relationship type as str in gds.graph.relationshipProperties.stream
#658
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
Changes from all commits
372329b
89e6f53
86521ce
9c74e2a
c8e0c58
9f15ffe
b64bdae
ce22056
c964cd1
f1cd3eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,13 +70,6 @@ def _handle_properties( | |
| ) | ||
|
|
||
|
|
||
| class GraphElementPropertyRunner(GraphEntityOpsBaseRunner): | ||
| @compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0)) | ||
| def stream(self, G: Graph, node_properties: str, node_labels: Strings = ["*"], **config: Any) -> DataFrame: | ||
| self._namespace += ".stream" | ||
| return self._handle_properties(G, node_properties, node_labels, config) | ||
|
|
||
|
|
||
| class GraphNodePropertyRunner(GraphEntityOpsBaseRunner): | ||
| @compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0)) | ||
| @filter_id_func_deprecation_warning() | ||
|
|
@@ -197,6 +190,16 @@ def drop(self, G: Graph, node_properties: List[str], **config: Any) -> "Series[A | |
| ).squeeze() | ||
|
|
||
|
|
||
| class GraphRelationshipPropertyRunner(GraphEntityOpsBaseRunner): | ||
| @compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0)) | ||
| def stream( | ||
| self, G: Graph, relationship_property: str, relationship_types: Strings = ["*"], **config: Any | ||
| ) -> DataFrame: | ||
| self._namespace += ".stream" | ||
| relationship_types = [relationship_types] if isinstance(relationship_types, str) else relationship_types | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would suggest to do this transformation as part of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. created a card to fix this inconsistency as well in gds
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I've made an experiment where I put this wrapping into a list in |
||
| return self._handle_properties(G, relationship_property, relationship_types, config) | ||
|
|
||
|
|
||
| class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner): | ||
| @compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0)) | ||
| def stream( | ||
|
|
@@ -209,6 +212,8 @@ def stream( | |
| ) -> DataFrame: | ||
| self._namespace += ".stream" | ||
|
|
||
| relationship_types = [relationship_types] if isinstance(relationship_types, str) else relationship_types | ||
|
|
||
| result = self._handle_properties(G, relationship_properties, relationship_types, config) | ||
|
|
||
| # new format was requested, but the query was run via Cypher | ||
|
|
||
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
def relationshipPropertyis the only one what uses this runner..? 😮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.
Yes, so it was renamed, moved closer to
GraphRelationshipPropertiesRunnerand added wrapping into a list if string was passed.