Skip to content

Commit

Permalink
AsyncRelationshipManager.get and .get_or_none should be async #847
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusconjeaud committed Dec 13, 2024
1 parent 72d8029 commit 3c1e043
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions neomodel/async_/relationship_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,23 +323,23 @@ def _new_traversal(self) -> AsyncTraversal:
return AsyncTraversal(self.source, self.name, self.definition)

# The methods below simply proxy the match engine.
def get(self, **kwargs: Any) -> AsyncNodeSet:
async def get(self, **kwargs: Any) -> AsyncNodeSet:
"""
Retrieve a related node with the matching node properties.
:param kwargs: same syntax as `NodeSet.filter()`
:return: node
"""
return AsyncNodeSet(self._new_traversal()).get(**kwargs)
return await AsyncNodeSet(self._new_traversal()).get(**kwargs)

def get_or_none(self, **kwargs: dict) -> AsyncNodeSet:
async def get_or_none(self, **kwargs: dict) -> AsyncNodeSet:
"""
Retrieve a related node with the matching node properties or return None.
:param kwargs: same syntax as `NodeSet.filter()`
:return: node
"""
return AsyncNodeSet(self._new_traversal()).get_or_none(**kwargs)
return await AsyncNodeSet(self._new_traversal()).get_or_none(**kwargs)

Check warning on line 342 in neomodel/async_/relationship_manager.py

View check run for this annotation

Codecov / codecov/patch

neomodel/async_/relationship_manager.py#L342

Added line #L342 was not covered by tests

def filter(self, *args: Any, **kwargs: dict) -> "AsyncBaseSet":
"""
Expand Down

0 comments on commit 3c1e043

Please sign in to comment.