Skip to content
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

Inject a GetOrCreateMixin to Node and Relationship. #244

Merged
merged 20 commits into from
Sep 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5f772d2
Align develop and main branch (#237)
katarinasupe Apr 7, 2023
e1e5af4
Merge branch 'main' into develop
katarinasupe Apr 7, 2023
2747ddd
Inject a GetOrCreateMixin to Node and Relationship.
aalekhpatel07 May 11, 2023
a8ed134
Use the imported GQLAlchemyError instead of a fully qualified path.
aalekhpatel07 May 11, 2023
d4e431a
Use the imported Tuple instead of fully qualified typing.Tuple
CdnCentreForChildProtection May 11, 2023
d05a0ad
Run black.
CdnCentreForChildProtection May 11, 2023
74e4380
suppress flake8's f821 on get_or_create definition
CdnCentreForChildProtection May 11, 2023
1cacdb8
Merge branch 'memgraph:develop' into develop
aalekhpatel07 May 11, 2023
cd23382
Merge pull request #1 from memgraph/main
aalekhpatel07 May 15, 2023
5d54bdc
Add tests for get_or_create and refactor the mixin into separate impl…
aalekhpatel07 Jun 1, 2023
ee25e1a
Apply black.
aalekhpatel07 Jun 1, 2023
d14b756
Apply black to tests as well.
aalekhpatel07 Jun 1, 2023
74bece8
typo fix in function signature.
aalekhpatel07 Jun 1, 2023
266f98c
Assert the counts of nodes and relationships in the test.
aalekhpatel07 Jun 1, 2023
aa11935
Apply black.
aalekhpatel07 Jun 1, 2023
5fbfee6
Add the .execute() to the query builder in failing tests and provide …
CdnCentreForChildProtection Jun 12, 2023
5aae7a6
another attempt to fix the query builder usage in tests.
CdnCentreForChildProtection Jun 12, 2023
b5d44aa
apply black fixes.
CdnCentreForChildProtection Jun 12, 2023
41c10bc
Fix tests by relying on the database identifier `_id` instead of the …
aalekhpatel07 Jun 14, 2023
cfa0aba
Remove unused test functions.
aalekhpatel07 Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use the imported Tuple instead of fully qualified typing.Tuple
CdnCentreForChildProtection committed May 11, 2023
commit d4e431afde86ed9373cdd254b818bf00bb7eb792
2 changes: 1 addition & 1 deletion gqlalchemy/models.py
Original file line number Diff line number Diff line change
@@ -550,7 +550,7 @@ def get_base_labels() -> Set[str]:
class GetOrCreateMixin:
"""Add a shortcut to either get or create a graph object in the database.
"""
def get_or_create(self, db: "Database") -> typing.Tuple["UniqueGraphObject", bool]:
def get_or_create(self, db: "Database") -> Tuple["UniqueGraphObject", bool]:
"""Return the graph entity and a flag for whether it was created in the database.

Args: