Skip to content

Conversation

@soerenreichardt
Copy link
Contributor

No description provided.

@soerenreichardt
Copy link
Contributor Author

Copy link
Member

@knutwalker knutwalker left a comment

Choose a reason for hiding this comment

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

Overall, looks good.
I have one remark about the default type, Github says there is a conflict, and TC says

graphdatascience/query_runner/arrow_query_runner.py:123: error: Argument 3 to "_run_arrow_property_get" of "ArrowQueryRunner" has incompatible type "Set[Any]"; expected "Dict[str, Any]"

return self._query_runner.run_query(query, params).squeeze() # type: ignore

@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
def stream(self, G: Graph, relationship_types: Strings = ["*"], **config: Any) -> DataFrame:
Copy link
Member

Choose a reason for hiding this comment

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

Using mutable values as default is a common trap in Python, as the materialized default value is the same shared instance, not a new list. The common pattern is to use something like

Suggested change
def stream(self, G: Graph, relationship_types: Strings = ["*"], **config: Any) -> DataFrame:
def stream(self, G: Graph, relationship_types: Strings = None, **config: Any) -> DataFrame:
if relationship_types is None:
relationship_types = ["*"]

though maybe that needs an update to the type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, didn't know that. I think that pattern is used across the codebase. Maybe we should create a card to fix all locations

@soerenreichardt soerenreichardt force-pushed the stream-topology-endpoint branch 3 times, most recently from b43a2dd to e26882f Compare July 28, 2022 08:29
Copy link
Member

@knutwalker knutwalker left a comment

Choose a reason for hiding this comment

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

Approving, waiting for whatever CI complains about :)

@soerenreichardt soerenreichardt force-pushed the stream-topology-endpoint branch 4 times, most recently from 4a44f19 to 0cfd4ae Compare July 28, 2022 13:44
Comment on lines 542 to 561
assert {e for e in result["sourceNodeId"]} == {0, 1}
assert {e for e in result["targetNodeId"]} == {1, 2}

Copy link
Contributor

@FlorentinD FlorentinD Aug 4, 2022

Choose a reason for hiding this comment

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

we did not depend on the neo4j ids before. As we are testing multiple version combinations on the same neo4j db, these fail here.

@soerenreichardt Instead we should get the neo-ids via a Cypher query and uses these for the expected ids

at least thats an idea

Copy link
Contributor

Choose a reason for hiding this comment

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

waiting for fix on server-side to be merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that should be the reason for the flaky tests here

@soerenreichardt soerenreichardt force-pushed the stream-topology-endpoint branch from f89882f to 49abf48 Compare August 9, 2022 07:46
@adamnsch adamnsch force-pushed the stream-topology-endpoint branch from 49abf48 to 1399a3c Compare August 10, 2022 13:53
@soerenreichardt soerenreichardt force-pushed the stream-topology-endpoint branch from 73ff48e to b4626fa Compare August 11, 2022 08:06
@adamnsch adamnsch merged commit 6e47a8f into neo4j:main Aug 11, 2022
@soerenreichardt soerenreichardt deleted the stream-topology-endpoint branch August 11, 2022 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants