Skip to content

Commit abbee73

Browse files
g-despotMasterMedokatarinasupebrunos252BorisTasevski
authored
Release GQLAlchemy 1.3 (#173)
* add code documentation * add receive and return types * add python-markdown with docusaurus renderer * add documentation for the query builder * Update docs * Fix formatting * Add tests for docs * Fix NodePartialQuery and Merge * Add load node test * Add node mapping test * Remove description * Minor fixes * Add test for relationship mapping * Add save relationship tests * Add load tests * Add testing without Field * Fix formatting in node labels and properties * Expose validator from pydantic * Add pydantic validator test * Refactor fixtures * Add base and simple merge tests * Remove space from trigger test * Ignore test test_run_1000_queries * Add test for constraints * Add new fixture * Add trigger ALL check, xor and constraint check * Add unique and exists contraints getters * Remove indices - not necessary * Add test for index attribute * Remove ensure indexes from fixture * Add and, or, xor tests * Add XOR and LOAD CSV to query builder and fix optional in Merge * Refactor code * Refactor tests * Add execute option to query builder * change tests * Fix review comments * Fix constraint tests * Remove print() * Replace execute_and_fetch with execute * Add create trigger without ON * Add simpler implementation * bootstrap_servers argument usage * property->item and removed spaces when it is label * List[str] instead of List * patch slight merge difference * pymgclient back to 1.1.0 * poetry.lock revert to develop setting * formatting correction * revert pyproject.toml to develop * revert poetry.lock to develop * black formatting patch * Update pymgclient and GQLAlchemy version * Update pymgclient and GQLAlchemy version * Change to load the whole streamer node * Remove unnecessary test * Add tests * Add batch save methods * Extend test * Format code * Fix save_node() method and add new test * Test node & relationship objects in query builder * Add tests for loading and properties * property->item and removed spaces when it is label * patch slight merge difference * pymgclient back to 1.1.0 * poetry.lock revert to develop setting * formatting correction * Update pymgclient and GQLAlchemy version * bootstrap_servers argument usage * List[str] instead of List * revert pyproject.toml to develop * revert poetry.lock to develop * Update pymgclient and GQLAlchemy version * Add load node test * Minor fixes * Add testing without Field * change tests * Change to load the whole streamer node * Remove unnecessary test * Update * Update tests * Change 'property' to 'item' in xor_where * Fix creating query with label * Add tests for label filtering in where * Update exception handling in test * Remove where tests * Fix if condition statement * Remove unnecessary variable assignments * [develop < T0040-GA] Add index on label (#113) * Add new exception class for index on label * Add index on label with tests * Add new lines * Add newlines again * Change test according to docs * Remove None from attrs.get * [develop < T0020-GA] Fix label inheritance (#105) * Research label behaviour * Save parent class labels * Fix black format * Fix inheritance from multiple classes * Remove prints * Refactor code * Reformat with black * Skip set union if not necessary * Replace if statement * Refactor code Co-authored-by: katarinasupe <supe.katarina@gmail.com> * [develop < T0039-GA] Change where procedure in query builder (#111) * Add new where methods and tests * Fix other tests accordingly (4) * Change error message check * Add better error handling and fix tests * Remove code duplication * Fix docstring * Add all docstrings * Make build where private * Refactor code * Fix black and flake * _build_where_query method updated * formatting Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> * [develop < T0035 - GA] Add table to graph importer (#100) * initial implementation of loader/translator logic; No tests added * query builder updated with two new functionalities; 1) Where Clause that compares two properties in database; 2) construct_query method that simply exposes _construct_query protected method * major naming changes; minor code reorganization * Blank spaces * Minor naming changes; Initial documentation; * code refactoring; introduced dacite * Introduced mapping class; Template Trigger Query introduced; Save row as relationship rehauled * Added drop all indexes and drop all triggers to memgraph; Trigger query creation is now static method * parameter fix * Minor Typing related changes * remove unused import * Format document * Fixed Query Builder Where test * Where clause additional fix * import fix * rename parameter; remove unnecessary typing * Small bugfix; Minor refactoring * drop database on start set to True in translate method * docs update; format of dataset introduced. If omitted, defaults to parquet Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> * [develop < T0046-GA] Add order by descending (#114) * Add order_by_desc and test * Fix DESC and add keyword in test * Desc inherits from OrderBy * Add new order_by * Order By revamped * Add type error and key arguments in tests * Add missing quotes * reduced line length under 80 * Remove trailing whitespaces * Add query check before execution * Where clause related classes rewritten * order by related methods moved to OrderByPartialQuery class * minor code fix * Add where and order_by examples to docstrings * Add NOT and fix tests * Add docstring examples * Remove blank lines after docstrings Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> * [develop < T0001-GA] Memgraph instance runner (#91) * Add initial instance runner * Update instance_runner * Update instance runner * Update Docker runner * Add Ubutnu runner * Remove Ubuntu instance runner * Remove prints * Fix instance_runner test * Fix binary test * Fix step order in workflow * Add sudo to test * Skip some tests in Windows workflow * Pull Docker image in Windows workflow * Update Docker image in Windows workflow * Update Docker image in Windows workflow * Skip some tests in Windows workflow * Remove Docker pull from Windows workflow * Add more tests and fix Docker bug * Refactor tests and binary runner * Refactor code and add docstrings * Fix docstring formatting * Fix formatting * Replace strings with constants * Add tests and new method * Add docker mark to test * Add constants and formatting * Add f strings * Add exponential backoff * Fix formatting * Fix formatting * Update connection retry delay time * Add checklist and closes keyword (#127) * [develop < T0023-GA] Add Azure Blob and local storage importers (#104) * initial implementation of loader/translator logic; No tests added * query builder updated with two new functionalities; 1) Where Clause that compares two properties in database; 2) construct_query method that simply exposes _construct_query protected method * major naming changes; minor code reorganization * Blank spaces * Blob datasource and importer * Minor naming changes; Initial documentation; * refactoring loaders.py * Boris loaders * code refactoring; introduced dacite * boriss commit, added comments * tiny fix * removed doubling of where method * Mrma; replaced filesystem_type str with enum, added ValueError output * added enum for DataLoaders, extracted supported filetypes * Update loaders.py * returned Boris' query_builder code * I am bad at git * Introduced mapping class; Template Trigger Query introduced; Save row as relationship rehauled * Added drop all indexes and drop all triggers to memgraph; Trigger query creation is now static method * parameter fix * Minor Typing related changes * remove unused import * Format document * added custom importers + minor changes * extracted some strings * minor fix * Fixed Query Builder Where test * Where clause additional fix * tests for importer * tiny fixes * Black formatting * further black formatting * workflows edit * flake8 format * reverted workflows * indentation * comment styling * removed changes not by me * added tests with other filetypes, bugfix * add filetype examples * merging bugfix * dodao print-eve kako Boris zapoveda * formatting for BLACK * orc file not readable on Windows * fix previous commit * latest changes * applied tests * docstrings update * poetry update * revert poetry.lock * one more * revert version of pywin32 * Update docstrings Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> * [develop < T0048-GA] Update and extend code documentation (#116) * Update the query_builder documentation * Update docs * [develop < TOO53-GA] Investigate Timeout error (#120) * Update dependencies * Increase Bolt session inactivity timeout * Update workflow * Update workflow * Add config flag --also-log-to-stderr * Catch Memgraph logs * Catch Memgraph logs * Update log level * Upload log as artifact * Add log file * Create new log directory * Run Action step even if error is thrown * Change session nactivity timeout * Change Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update GitHub action paths * Update GitHub action paths * Update GitHub action permissions * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * [develop < T0070-GA] Add more clauses for base classes (#139) * added load_csv, tests * add return base class, change CSV to Csv * black formatting * [develop < T0071-GA-bfs-and-shortest-path] added base class and integrated into edge query (#141) * added base class and integrated into edge query * on comments * comment fixes * Add minor docstring changes * Reorder imports * convert other @Property's to positive logic * boris comments * add pass to abstractmethod * removed temp var use Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> * [T0071-GA < BFS] add bfs class and tests (#142) * added base class and integrated into edge query * added bfs class and tests * rename to BreadthFirstSearch * on comments * on comments * comment fixes * mrma comments * Add minor docstring changes * Update memgraph.py * boris comments * flake8 fixes Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> * [develop < T0059-GA] Add SET method to the query builder (#128) * Introduced SET Clause support * Implementation Done; Tests Added * formatting * minor formatting * Removed templates * unused imports removed * unused imports removed * Rename to SetOperator and add new tests * Add query clause enum in exceptions Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> Co-authored-by: katarinasupe <supe.katarina@gmail.com> * [T0071-GA < DFS] add dfs and tests (#144) * added base class and integrated into edge query * add dfs and tests * on comments * add bounds tests and (e, v) -> (r, n) * comment fixes * mrma comments * blank line removal * boris comments * remove duplicate code * duplicate code * fix * [T0071-GA < wShortest] added WeightedShortestPath and tests (#143) * added base class and integrated into edge query * added wShortest and tests * on comments * comment fixes * mrma comments and refactoring * another * fix * make upper bound str since the init * [develop < T0026-GA] Wrap query modules (#130) * first draft * stash changes 2 * finished parse_signature * make it work, add docstrings * formatting * added tests + * reorganize tests * add mock test for get_procedures, to avoid needing MAGE * startswith -> starts_with * starts_with in docstring * ok i will not edit in github again. starts_with in description * refactor _parse_field * added QB test, moved parser to utilities, Kate changes * test fix * refactor and comments from Mrma * comments fixes * finish merge lol * [develop < T0081-GA] Rename Edge to Relationship (#145) * Rename edge to relationship; add kwargs in tests * Fix test on docs * [develop < TOO53-GA] Investigate Timeout error (#120) * Update dependencies * Increase Bolt session inactivity timeout * Update workflow * Update workflow * Add config flag --also-log-to-stderr * Catch Memgraph logs * Catch Memgraph logs * Update log level * Upload log as artifact * Add log file * Create new log directory * Run Action step even if error is thrown * Change session nactivity timeout * Change Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update GitHub action paths * Update GitHub action paths * Update GitHub action permissions * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * [develop < T0070-GA] Add more clauses for base classes (#139) * added load_csv, tests * add return base class, change CSV to Csv * black formatting * Change edge in loaders * Change labels_str -> type_str; edge_label-> relationship_type Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Bruno Sačarić <bruno.sacaric@gmail.com> * moved integrated algorithms (#147) * [develop < T0034-GA] Add Field to models (#122) * Add Field to models * Remove Field from gqlalchemy init * [develop < T0054-GA] Add option to suppress warning GQLAlchemySubclassNotFoundWarning (#121) * Ignore warning in tests * Set lazy loading to false * Add codeowner * host and port read only (#156) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * host and port read only Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * [develop < T0094-GA] Variable support for node and edge properties (#154) * added functionality and tests * add docstring * add test for relationship * black * migrated check to to_cypher_value * community fixes * change test names * type checking * renamed variable value to name * new connection private method (#157) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * new connection private method Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * [develop < T0074-GA] Remove sudo from instance_runner (#148) * Remove sudo * Remove unused import * exceptions fixed (#153) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * exceptions fixed * fixed stream tests * reformatting * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * exceptions fixed * fixed stream tests * reformatting * rebased * exceptions fixed * reformatting * renamed * fixed * Added new line Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * Add lazy argument to Memgraph (#159) * [develop < T0098-GA] Add datetime support (#161) * Add datetime support * Change value_type to value * Add new tests * Format timedelta and add datetime tests * Add datetimeKwMapping and change call to one-liner * Fix flake8 * Fix import formatting Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> * changed string variables for Blob and S3 kwargs (#151) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * changed string variables for Blob and S3 kwargs Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * [develop < T0086-GA] Change arguments in RETURN method (#146) * Change arguments in return method * Add backward compatibility * Add newline * Add minor changes * Add Iterable and fix if logic * add enum * Remove super call; Add Iterable to OrderBy; Remove read_str method * Change arguments for yield, with; create new class * Remove unnecessary super constructor call * [develop < T0071-GA-bfs-and-shortest-path] added base class and integrated into edge query (#141) * added base class and integrated into edge query * on comments * comment fixes * Add minor docstring changes * Reorder imports * convert other @Property's to positive logic * boris comments * add pass to abstractmethod * removed temp var use Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> * [T0071-GA < BFS] add bfs class and tests (#142) * added base class and integrated into edge query * added bfs class and tests * rename to BreadthFirstSearch * on comments * on comments * comment fixes * mrma comments * Add minor docstring changes * Update memgraph.py * boris comments * flake8 fixes Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> * [develop < T0059-GA] Add SET method to the query builder (#128) * Introduced SET Clause support * Implementation Done; Tests Added * formatting * minor formatting * Removed templates * unused imports removed * unused imports removed * Rename to SetOperator and add new tests * Add query clause enum in exceptions Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> Co-authored-by: katarinasupe <supe.katarina@gmail.com> * [T0071-GA < DFS] add dfs and tests (#144) * added base class and integrated into edge query * add dfs and tests * on comments * add bounds tests and (e, v) -> (r, n) * comment fixes * mrma comments * blank line removal * boris comments * remove duplicate code * duplicate code * fix * [T0071-GA < wShortest] added WeightedShortestPath and tests (#143) * added base class and integrated into edge query * added wShortest and tests * on comments * comment fixes * mrma comments and refactoring * another * fix * make upper bound str since the init * [develop < T0059-GA] Add SET method to the query builder (#128) * Introduced SET Clause support * Implementation Done; Tests Added * formatting * minor formatting * Removed templates * unused imports removed * unused imports removed * Rename to SetOperator and add new tests * Add query clause enum in exceptions Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> Co-authored-by: katarinasupe <supe.katarina@gmail.com> * [develop < T0026-GA] Wrap query modules (#130) * first draft * stash changes 2 * finished parse_signature * make it work, add docstrings * formatting * added tests + * reorganize tests * add mock test for get_procedures, to avoid needing MAGE * startswith -> starts_with * starts_with in docstring * ok i will not edit in github again. starts_with in description * refactor _parse_field * added QB test, moved parser to utilities, Kate changes * test fix * refactor and comments from Mrma * comments fixes * finish merge lol * Add missing quotes and remove duplicate * Remove extra line in exceptions * Change to return only item * Remove Iterable from argument type * Change elif to if and remove else * Remove Iterable from order_by * [develop < T0081-GA] Rename Edge to Relationship (#145) * Rename edge to relationship; add kwargs in tests * Fix test on docs * [develop < TOO53-GA] Investigate Timeout error (#120) * Update dependencies * Increase Bolt session inactivity timeout * Update workflow * Update workflow * Add config flag --also-log-to-stderr * Catch Memgraph logs * Catch Memgraph logs * Update log level * Upload log as artifact * Add log file * Create new log directory * Run Action step even if error is thrown * Change session nactivity timeout * Change Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update Ubuntu GitHub job * Update GitHub action paths * Update GitHub action paths * Update GitHub action permissions * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * Update GitHub action * [develop < T0070-GA] Add more clauses for base classes (#139) * added load_csv, tests * add return base class, change CSV to Csv * black formatting * Change edge in loaders * Change labels_str -> type_str; edge_label-> relationship_type Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Bruno Sačarić <bruno.sacaric@gmail.com> * moved integrated algorithms (#147) * [develop < T0034-GA] Add Field to models (#122) * Add Field to models * Remove Field from gqlalchemy init * [develop < T0054-GA] Add option to suppress warning GQLAlchemySubclassNotFoundWarning (#121) * Ignore warning in tests * Set lazy loading to false * Add codeowner * host and port read only (#156) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * host and port read only Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * [develop < T0094-GA] Variable support for node and edge properties (#154) * added functionality and tests * add docstring * add test for relationship * black * migrated check to to_cypher_value * community fixes * change test names * type checking * renamed variable value to name * new connection private method (#157) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * new connection private method Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * [develop < T0074-GA] Remove sudo from instance_runner (#148) * Remove sudo * Remove unused import * exceptions fixed (#153) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * exceptions fixed * fixed stream tests * reformatting * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * exceptions fixed * fixed stream tests * reformatting * rebased * exceptions fixed * reformatting * renamed * fixed * Added new line Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * moved integrated algorithms (#147) * Add lazy argument to Memgraph (#159) * [develop < T0098-GA] Add datetime support (#161) * Add datetime support * Change value_type to value * Add new tests * Format timedelta and add datetime tests * Add datetimeKwMapping and change call to one-liner * Fix flake8 * Fix import formatting Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> * changed string variables for Blob and S3 kwargs (#151) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * changed string variables for Blob and S3 kwargs Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * Add example in docstring and docs test Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> Co-authored-by: Bruno Sačarić <bruno.sacaric@gmail.com> Co-authored-by: Boris Taševski <36607228+BorisTasevski@users.noreply.github.com> Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: niko4299 <51059248+niko4299@users.noreply.github.com> * fix bad query in save_relationship_with_id (#166) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * fix bad query in save_relationship_with_id Fixes the error in the cypher query of memgraph.save_relationship_with_id() caused by an unbound variable in the return statement. Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * [develop < T0089-GA] Create Operator Enum (#165) * Add WhereOperator enum and update tests * Add exceptions if str value is wrong * Change to Operator * fix bad query in save_relationship_with_id (#166) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * fix bad query in save_relationship_with_id Fixes the error in the cypher query of memgraph.save_relationship_with_id() caused by an unbound variable in the return statement. Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> Co-authored-by: Daniel <dadevel-github@webhq.eu> Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> * [develop < T0066-GA] Add foreach to query builder (#135) * foreach using another query_builder for update_clause * add comment * added base class * added functionality and tests * add docstring * add test for relationship * black * migrated check to to_cypher_value * community fixes * change test names * type checking * make tests work good * black format * Update docstring Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * non double negative logic * done did double negation fix * add Set[str] * add set[str] * missing parantheses * added Set import * black format * Add minor changes * add example and kwarg names * formatting, renamed update_clauses to update_clause * removed checking None in properties Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> * [develop < T0093] Add query module arguments as tuples (#155) * Added arguments of query modules as tuples * Replaced foreach argument x for arg * Added another test with query procedures as tuples * Flake corrected and poetry * Added parsing of qm arguments to utilities * Removed self from utilities function Co-authored-by: josipmrden <josip.mrden@external-basf.com> * [develop < T0106] fix @Property being optional when they are not (#167) * I see no changes, wake up in the morning and I ask myself * move None check to constructor * [develop < T0103-GA] Add docstring examples (#162) * Add docstring examples * Add kwards * Fix test union typo * Update set docstring examples + add execute * Update to Operator in examples * Update skip and limit arguments * fix bad query in save_relationship_with_id (#166) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * fix bad query in save_relationship_with_id Fixes the error in the cypher query of memgraph.save_relationship_with_id() caused by an unbound variable in the return statement. Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> * [develop < T0089-GA] Create Operator Enum (#165) * Add WhereOperator enum and update tests * Add exceptions if str value is wrong * Change to Operator * fix bad query in save_relationship_with_id (#166) * Update bug_report.md * [master < T0068-GA] Update README (#136) * Update README * Fix broken link * Move emojis * Add table to title * fix bad query in save_relationship_with_id Fixes the error in the cypher query of memgraph.save_relationship_with_id() caused by an unbound variable in the return statement. Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> Co-authored-by: Daniel <dadevel-github@webhq.eu> Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> * Minor language fixes Co-authored-by: Daniel <dadevel-github@webhq.eu> Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> * [develop < T0067] Sync push stream query modules (#158) * Added query modules from gqlalchemy * with kafka stream * fixed * test * added stream module loading * Added query modules from gqlalchemy * with kafka stream * fixed * test * added stream module loading * added tests * poetry fixed * something wrong with test * test still not fixed, execute and fetch problem * fixed tests * Added query modules from gqlalchemy * with kafka stream * fixed * test * added stream module loading * added tests * Added query modules from gqlalchemy * with kafka stream * fixed * test * added stream module loading * poetry fixed * something wrong with test * test still not fixed, execute and fetch problem * fixed tests * toml * test hopefully fixed * Added return type for integrations with query modules * Rename gqlalchemy error handler to database error handler * Formatting * Made add_query_module as a public method so users can add their own query modules to Memgraph * Update docstring for adding query modules * Renamed test file * Made add_query_module function public in tests * Function correction * Formatting * fixed tests * reformated Co-authored-by: josipmrden <josip.mrden@external-basf.com> * [T0093 < T0096] Wrap MAGE query modules for autocompletion (#168) * Added arguments of query modules as tuples * Added modules in Memgraph query builder * Added modules for memgraph mage * Replaced foreach argument x for arg * Added another test with query procedures as tuples * Flake corrected and poetry * Added parsing of qm arguments to utilities * Removed self from utilities function * Written tests to see if every method in code is present in Memgraph * Assert reverse case, that every memgraph query module is written inside code * Updated documentation for Mage query builder * Formatting * Imports from 3rd party libraries go before gqlalchemy * Format imports * Add networkx to github workflows * Add networkx to github workflows attempt 2 * Add networkx to github workflows attempt 3 * Add networkx to github workflows attempt 4 * Add networkx to github workflows attempt 5 * Add networkx to github workflows attempt 6 * Add networkx to github workflows attempt 7 * Add networkx to github workflows attempt 8 * Add numpy to installed packages * Addded scipy to installed packages * Corrected Sudo command to sudo * Removed sudo completely from the windows github workflows Co-authored-by: josipmrden <josip.mrden@external-basf.com> * [develop < T0091-GA] Add support for Neo4j (#149) * Add Neo4j OGM support * Update workflow * Update workflow * Update workflow * Refactor code * Refactor code * Fix ensure_indexes() * Refactor code * Add Neo4j tests for query builder * Refactor query builder and tests * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * Refactor query builder tests * Replace Connection objects with Database * Reorder imports * Update docstrings and database arguments * Remove unused import * Add merge related updates * Refactor code and address comments * Fix poetry.lock * Fix poetry.lock * Fix dependencies * Fix pip installation for Memgraph * Update workflow * Update workflow * Update workflow * Update workflow * Update workflow * [develop < T0099 GA] replace relative imports (#160) * first step * first try * try * absolute in init * all gqlalchemy/ absolutes * Reorder and group imports * Reorder imports * return of the Operator * PEP8 standard * fix import error (lol) * Installing networkx with windows workflow * remove duplicate import Co-authored-by: Ivan Despot <ivan.g.despot@outlook.com> Co-authored-by: g-despot <66276597+g-despot@users.noreply.github.com> Co-authored-by: josipmrden <josip.mrden@external-basf.com> * [develop < T0100-GA] Wait for Active Connection (#164) * Implemented wait for connection; Tests pending * wait for connection completed; code refactoring done * merge error * formatting errors fixed * minor update * rename variable * formatting error fixed * docstring added Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> * [develop < ] Rename relationship type argument (#171) * renamed labels to type * renamed to not conflict with PartialQuery type * Update README (#169) * [develop < T0109-GA] Remove excess Iterable type (#172) * Update arg type * Remove unused imports * [develop < ] Rename relationship type argument (#171) * renamed labels to type * renamed to not conflict with PartialQuery type * Update README (#169) Co-authored-by: Bruno Sačarić <bruno.sacaric@gmail.com> * [master < T0107-GA] Update docs generation (#170) * Update docs generation * Update documentation * Release GQLAlchemy 1.3 Co-authored-by: MasterMedo <mislav.vuletic@gmail.com> Co-authored-by: katarinasupe <supe.katarina@gmail.com> Co-authored-by: Bruno Sacaric <bruno.sacaric@gmail.com> Co-authored-by: Bruno Sačarić <31968691+brunos252@users.noreply.github.com> Co-authored-by: Boris Taševski <36607228+BorisTasevski@users.noreply.github.com> Co-authored-by: Katarina Supe <61758502+katarinasupe@users.noreply.github.com> Co-authored-by: Boris Tasevski <boris.tasevski@memgraph.io> Co-authored-by: niko4299 <51059248+niko4299@users.noreply.github.com> Co-authored-by: Daniel <dadevel-github@webhq.eu> Co-authored-by: Josipmrden <josip.mrden@memgraph.io> Co-authored-by: josipmrden <josip.mrden@external-basf.com>
1 parent 0c7cf5b commit abbee73

81 files changed

Lines changed: 9321 additions & 3233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @g-despot @Josipmrden @BorisTasevski @katarinasupe @brunos252
1+
* @g-despot @Josipmrden @BorisTasevski @katarinasupe @brunos252 @niko4299

.github/workflows/build-and-test.yml

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Build and Test
22

33
env:
4-
MG_VERSION: "2.1.1"
4+
MG_VERSION: "2.3.0"
55
POETRY_VERSION: "1.1.4"
66

77
on:
@@ -23,25 +23,39 @@ jobs:
2323
steps:
2424
- name: Checkout Repository
2525
uses: actions/checkout@v2
26-
- name: Set up Python ${{ matrix.py-version }}
26+
- name: Set up Python ${{ matrix.python-version }}
2727
uses: actions/setup-python@v2
2828
with:
2929
python-version: ${{ matrix.python-version }}
30+
- name: Set up pip and install packages
31+
run: |
32+
python -m pip install -U pip
33+
sudo -H pip install networkx numpy scipy
3034
- name: Setup poetry
3135
uses: abatilo/actions-poetry@v2.0.0
3236
with:
3337
poetry-version: ${{ env.POETRY_VERSION }}
34-
- name: Run memgraph instance
35-
run: |
36-
docker run -d -p 7687:7687 memgraph/memgraph --telemetry-enabled=False
3738
- name: Install Memgraph
3839
run: |
39-
curl -O https://download.memgraph.com/memgraph/v2.2.1/ubuntu-20.04/memgraph_2.2.1-1_amd64.deb
40-
sudo dpkg -i memgraph_2.2.1-1_amd64.deb
40+
mkdir /home/runner/memgraph
41+
curl -L https://download.memgraph.com/memgraph/v${{env.MG_VERSION}}/ubuntu-20.04/memgraph_${{env.MG_VERSION}}-1_amd64.deb --output /home/runner/memgraph/memgraph-community.deb
42+
sudo dpkg -i /home/runner/memgraph/memgraph-community.deb
43+
sudo systemctl stop memgraph
44+
sudo runuser -l memgraph -c '/usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-session-inactivity-timeout=300 --data-directory="/var/lib/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --also-log-to-stderr=true --log-file=/var/log/memgraph/memgraph-ubuntu-${{ matrix.python-version }}.log' &
45+
sleep 1 # Wait for Memgraph a bit.
46+
- name: Install Neo4j
47+
run: |
48+
docker run -p 7474:7474 -p 7688:7687 -d -v $HOME/neo4j/data:/data -v $HOME/neo4j/logs:/logs -v $HOME/neo4j/import:/var/lib/neo4j/import -v $HOME/neo4j/plugins:/plugins --env NEO4J_AUTH=neo4j/test neo4j:4.4.7
4149
- name: Test project
4250
run: |
4351
poetry install
44-
poetry run pytest -vvv -m "not slow"
52+
poetry run pytest -vvv -m "not slow and not ubuntu and not docker"
53+
- name: Use the Upload Artifact GitHub Action
54+
uses: actions/upload-artifact@v3
55+
if: always()
56+
with:
57+
name: assets-for-download
58+
path: /var/log/memgraph
4559

4660
build_and_test_windows:
4761
if: github.event.pull_request.draft == false
@@ -53,21 +67,44 @@ jobs:
5367
steps:
5468
- name: Checkout Repository
5569
uses: actions/checkout@v2
56-
- name: Set up Python ${{ matrix.py-version }}
70+
- name: Set up Python ${{ matrix.python-version }}
5771
uses: actions/setup-python@v2
5872
with:
5973
python-version: ${{ matrix.python-version }}
74+
- name: Set up pip and install packages
75+
run: |
76+
python -m pip install -U pip
77+
python -m pip install networkx numpy scipy
6078
- uses: Vampire/setup-wsl@v1
6179
with:
6280
distribution: Ubuntu-20.04
6381
- name: Download, install and run Memgraph under WSL
6482
shell: wsl-bash {0} # root shell
6583
run: |
66-
mkdir ~/memgraph
67-
curl -L https://download.memgraph.com/memgraph/v${{env.MG_VERSION}}/ubuntu-20.04/memgraph_${{env.MG_VERSION}}-1_amd64.deb --output ~/memgraph/memgraph-community.deb
68-
dpkg -i ~/memgraph/memgraph-community.deb
69-
nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' &
84+
sudo apt-get update
85+
sudo apt-get -y install python3 python3-pip ipython3
86+
pip3 install networkx numpy scipy
87+
mkdir /memgraph
88+
curl -L https://download.memgraph.com/memgraph/v${{env.MG_VERSION}}/ubuntu-20.04/memgraph_${{env.MG_VERSION}}-1_amd64.deb --output /memgraph/memgraph-community.deb
89+
dpkg -i /memgraph/memgraph-community.deb
90+
mkdir /mnt/c/memgraph
91+
runuser -l memgraph -c '/usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-session-inactivity-timeout=300 --data-directory="/mnt/c/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --also-log-to-stderr=true --log-file=/mnt/c/memgraph/memgraph-windows-${{ matrix.python-version }}.log' &
7092
sleep 1 # Wait for Memgraph a bit.
93+
- name: Download, install and run Neo4j under WSL
94+
shell: wsl-bash {0} # root shell
95+
run: |
96+
curl -fsSL https://debian.neo4j.com/neotechnology.gpg.key | apt-key add -
97+
add-apt-repository "deb https://debian.neo4j.com stable 4.2"
98+
sudo apt-get -y install neo4j=1:4.2.1
99+
neo4j-admin set-initial-password test
100+
mkdir -p /mnt/c/neo4j/${{ matrix.python-version }}
101+
sed -i 's/#dbms.connector.bolt.listen_address=:7687/dbms.connector.bolt.listen_address=:7688/g' /etc/neo4j/neo4j.conf
102+
sed -i 's/#dbms.connector.bolt.advertised_address=:7687/dbms.connector.bolt.advertised_address=:7688/g' /etc/neo4j/neo4j.conf
103+
sed -i 's/#dbms.default_listen_address=0.0.0.0/dbms.default_listen_address=0.0.0.0/g' /etc/neo4j/neo4j.conf
104+
sed -i 's/dbms.directories.logs=\/var\/log\/neo4j/dbms.directories.logs=\/mnt\/c\/neo4j\/${{ matrix.python-version }}/g' /etc/neo4j/neo4j.conf
105+
cp /etc/neo4j/neo4j.conf /mnt/c/neo4j/${{ matrix.python-version }}/neo4j.conf
106+
sudo service neo4j start
107+
sleep 10 # Wait for Neo4j a bit.
71108
- name: Setup poetry
72109
uses: abatilo/actions-poetry@v2.0.0
73110
with:
@@ -76,3 +113,15 @@ jobs:
76113
run: |
77114
poetry install
78115
poetry run pytest -vvv -m "not slow and not ubuntu and not docker"
116+
- name: Save Memgraph Logs
117+
uses: actions/upload-artifact@v3
118+
if: always()
119+
with:
120+
name: memgraph-log
121+
path: C:\memgraph
122+
- name: Save Neo4j Logs
123+
uses: actions/upload-artifact@v3
124+
if: always()
125+
with:
126+
name: neo4j-log
127+
path: C:\neo4j

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,20 @@ When building a Cypher query, you can use a set of methods that are wrappers aro
9191

9292
```python
9393
from gqlalchemy import create, match
94+
from gqlalchemy.query_builder import Operator
9495

9596
query_create = create()
9697
.node(labels="Person", name="Leslie")
97-
.to(edge_label="FRIENDS_WITH")
98+
.to(relationship_type="FRIENDS_WITH")
9899
.node(labels="Person", name="Ron")
99100
.execute()
100101

101102
query_match = match()
102103
.node(labels="Person", variable="p1")
103104
.to()
104105
.node(labels="Person", variable="p2")
105-
.where(item="p1.name", operator="=", literal="Leslie")
106-
.return_({"p1":"p1"})
106+
.where(item="p1.name", operator=Operator.EQUAL, literal="Leslie")
107+
.return_(results=["p1", ("p2", "second")])
107108
.execute()
108109
```
109110
</details>
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
sidebar_label: integrated_algorithms
3+
title: gqlalchemy.graph_algorithms.integrated_algorithms
4+
---
5+
6+
## IntegratedAlgorithm Objects
7+
8+
```python
9+
class IntegratedAlgorithm(ABC)
10+
```
11+
12+
Abstract class modeling Memgraph&#x27;s built-in graph algorithms.
13+
14+
These algorithms are integrated into Memgraph&#x27;s codebase and are called
15+
within a relationship part of a query. For instance:
16+
MATCH p = (:City {name: &quot;Paris&quot;})
17+
-[:Road * bfs (r, n | r.length &lt;= 200 AND n.name != &quot;Metz&quot;)]-&gt;
18+
(:City {name: &quot;Berlin&quot;})
19+
20+
#### \_\_str\_\_
21+
22+
```python
23+
@abstractmethod
24+
def __str__() -> str
25+
```
26+
27+
Instance of IntegratedAlgorithm subclass is used as a string
28+
29+
#### to\_cypher\_lambda
30+
31+
```python
32+
@staticmethod
33+
def to_cypher_lambda(expression: str) -> str
34+
```
35+
36+
Method for creating a general lambda expression.
37+
38+
Variables `r` and `n` stand for relationship and node. The expression is
39+
used e.g. for a filter lambda, to use only relationships of length less
40+
than 200:
41+
expression=&quot;r.length &lt; 200&quot;
42+
with the filter lambda being:
43+
(r, n | r.length &lt; 200)
44+
45+
**Arguments**:
46+
47+
- `expression` - Lambda conditions or statements.
48+
49+
## BreadthFirstSearch Objects
50+
51+
```python
52+
class BreadthFirstSearch(IntegratedAlgorithm)
53+
```
54+
55+
Build a BFS call for a Cypher query.
56+
57+
The Breadth-first search can be called in Memgraph with Cypher queries such
58+
as: `MATCH (a {id: 723})-[*BFS ..10 (r, n | r.x &gt; 12 AND n.y &lt; 3)]-() RETURN *;`
59+
It is called inside the relationship clause, `*BFS` naming the algorithm,
60+
`..10` specifying depth bounds, and `(r, n | &lt;expression&gt;)` is a filter
61+
lambda.
62+
63+
#### \_\_init\_\_
64+
65+
```python
66+
def __init__(lower_bound: int = None, upper_bound: int = None, condition: str = None) -> None
67+
```
68+
69+
**Arguments**:
70+
71+
- `lower_bound` - Lower bound for path depth. Defaults to `None`.
72+
- `upper_bound` - Upper bound for path depth. Defaults to `None`.
73+
- `condition` - Filter through nodes and relationships that pass this
74+
condition. Defaults to `None`.
75+
76+
#### \_\_str\_\_
77+
78+
```python
79+
def __str__() -> str
80+
```
81+
82+
Get a Cypher query string for this algorithm.
83+
84+
#### to\_cypher\_bounds
85+
86+
```python
87+
def to_cypher_bounds() -> str
88+
```
89+
90+
If bounds are specified, returns them in grammar-defined form.
91+
92+
## DepthFirstSearch Objects
93+
94+
```python
95+
class DepthFirstSearch(IntegratedAlgorithm)
96+
```
97+
98+
Build a DFS call for a Cypher query.
99+
The Depth-First Search can be called in Memgraph with Cypher queries
100+
such as:
101+
MATCH (a {id: 723})-[* ..10 (r, n | r.x &gt; 12 AND n.y &lt; 3)]-() RETURN *;
102+
It is called inside the relationship clause, &quot;*&quot; naming the algorithm
103+
(&quot;*&quot; without &quot;DFS&quot; because it is defined like such in openCypher),
104+
&quot;..10&quot; specifying depth bounds, and &quot;(r, n | &lt;expression&gt;)&quot; is a filter
105+
lambda.
106+
107+
#### \_\_init\_\_
108+
109+
```python
110+
def __init__(lower_bound: int = None, upper_bound: int = None, condition: str = None) -> None
111+
```
112+
113+
**Arguments**:
114+
115+
- `lower_bound` - Lower bound for path depth. Defaults to None.
116+
- `upper_bound` - Upper bound for path depth. Defaults to None.
117+
- `condition` - Filter through nodes and relationships that pass this
118+
condition. Defaults to None.
119+
120+
#### \_\_str\_\_
121+
122+
```python
123+
def __str__() -> str
124+
```
125+
126+
get Cypher query string for this algorithm.
127+
128+
#### to\_cypher\_bounds
129+
130+
```python
131+
def to_cypher_bounds() -> str
132+
```
133+
134+
If bounds are specified, returns them in grammar-defined form.
135+
136+
## WeightedShortestPath Objects
137+
138+
```python
139+
class WeightedShortestPath(IntegratedAlgorithm)
140+
```
141+
142+
Build a Djikstra shortest path call for a Cypher query
143+
The weighted shortest path algorithm can be called in Memgraph with Cypher
144+
queries such as:
145+
&quot; MATCH (a {id: 723})-[r *WSHORTEST 10 (r, n | r.weight) weight_sum
146+
(r, n | r.x &gt; 12 AND r.y &lt; 3)]-(b {id: 882}) RETURN * &quot;
147+
It is called inside the relationship clause, &quot;*WSHORTEST&quot; naming the
148+
algorithm, &quot;10&quot; specifying search depth bounds, and &quot;(r, n | &lt;expression&gt;)&quot;
149+
is a filter lambda, used to filter which relationships and nodes to use.
150+
151+
#### \_\_init\_\_
152+
153+
```python
154+
def __init__(upper_bound: int = None, condition: str = None, total_weight_var: str = DEFAULT_TOTAL_WEIGHT, weight_property: str = DEFAULT_WEIGHT_PROPERTY) -> None
155+
```
156+
157+
**Arguments**:
158+
159+
- `upper_bound` - Upper bound for path depth. Defaults to None.
160+
- `condition` - Filter through nodes and relationships that pass this
161+
condition. Defaults to None.
162+
- `total_weight_var` - Variable defined as the sum of all weights on
163+
path being returned. Defaults to &quot;total_weight&quot;.
164+
- `weight_property` - property being used as weight. Defaults to
165+
&quot;r.weight&quot;.
166+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
sidebar_label: query_builder
3+
title: gqlalchemy.graph_algorithms.query_builder
4+
---
5+
6+
## MemgraphQueryBuilder Objects
7+
8+
```python
9+
class MemgraphQueryBuilder(QueryBuilder)
10+
```
11+
12+
This query builder extends the usual Cypher query builder capabilities with Memgraph&#x27;s query modules.
13+
User gets with this module autocomplete features of graph algorithms.
14+
Documentation on the methods can be found on Memgraph&#x27;s web page.
15+
16+
## MageQueryBuilder Objects
17+
18+
```python
19+
class MageQueryBuilder(MemgraphQueryBuilder)
20+
```
21+
22+
This query builder extends the Memgraph query builder with Memgraph MAGE graph algorithm Cypher options.
23+
User gets with this module autocomplete features of graph algorithms written in MAGE library.
24+
Documentation on the methods can be found on Memgraph&#x27;s web page.
25+

0 commit comments

Comments
 (0)