Skip to content

Commit 12a05b6

Browse files
g-despotMasterMedokatarinasupebrunos252BorisTasevski
authored
[main < develop] Publish GQLAlchemy 1.2 (#129)
* 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 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>
1 parent e12093f commit 12a05b6

57 files changed

Lines changed: 6575 additions & 821 deletions

Some content is hidden

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

.github/pull_request_template.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Please briefly explain the changes you made here.
44

55
### Pull request type
66

7+
Please delete options that are not relevant.
8+
79
- [ ] Bugfix
810
- [ ] Feature
911
- [ ] Code style update (formatting, renaming)
@@ -15,7 +17,18 @@ Please briefly explain the changes you made here.
1517

1618
### Related issues
1719

18-
Delete section if this PR doesn't resolve any issues. Link the issue if it does.
20+
Delete section if this PR doesn't resolve any issues.
21+
22+
Closes (link to issue)
23+
24+
### Checklist:
25+
26+
- [ ] My code follows the style guidelines of this project
27+
- [ ] I have performed a self-review of my own code
28+
- [ ] I have made corresponding changes to the documentation
29+
- [ ] My changes generate no new warnings
30+
- [ ] I have added tests that prove my fix is effective or that my feature works
31+
- [ ] New and existing unit tests pass locally with my changes
1932

2033
######################################
2134

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ jobs:
3434
- name: Run memgraph instance
3535
run: |
3636
docker run -d -p 7687:7687 memgraph/memgraph --telemetry-enabled=False
37+
- name: Install Memgraph
38+
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
3741
- name: Test project
3842
run: |
3943
poetry install
@@ -71,4 +75,4 @@ jobs:
7175
- name: Test project
7276
run: |
7377
poetry install
74-
poetry run pytest -vvv -m "not slow"
78+
poetry run pytest -vvv -m "not slow and not ubuntu and not docker"

docs/reference/gqlalchemy/connection.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

docs/reference/gqlalchemy/disk_storage.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ title: gqlalchemy.disk_storage
99
class OnDiskPropertyDatabase(ABC)
1010
```
1111

12+
An abstract class for implementing on-disk storage features with specific databases.
13+
1214
#### save\_node\_property
1315

1416
```python
@@ -79,6 +81,15 @@ def execute_query(query: str) -> List[str]
7981

8082
Executes an SQL query on the on disk property database.
8183

84+
**Arguments**:
85+
86+
- `query` - A string representing an SQL query.
87+
88+
89+
**Returns**:
90+
91+
A list of strings representing the results of the query.
92+
8293
#### drop\_database
8394

8495
```python
@@ -95,6 +106,12 @@ def save_node_property(node_id: int, property_name: str, property_value: str) ->
95106

96107
Saves a node property to an on disk database.
97108

109+
**Arguments**:
110+
111+
- `node_id` - An integer representing the internal id of the node.
112+
- `property_name` - A string representing the name of the property.
113+
- `property_value` - A string representing the value of the property.
114+
98115
#### load\_node\_property
99116

100117
```python
@@ -103,6 +120,16 @@ def load_node_property(node_id: int, property_name: str) -> Optional[str]
103120

104121
Loads a node property from an on disk database.
105122

123+
**Arguments**:
124+
125+
- `node_id` - An integer representing the internal id of the node.
126+
- `property_name` - A string representing the name of the property.
127+
128+
129+
**Returns**:
130+
131+
An optional string representing the property value.
132+
106133
#### delete\_node\_property
107134

108135
```python
@@ -111,6 +138,11 @@ def delete_node_property(node_id: int, property_name: str) -> None
111138

112139
Deletes a node property from an on disk database.
113140

141+
**Arguments**:
142+
143+
- `node_id` - An integer representing the internal id of the node.
144+
- `property_name` - A string representing the name of the property.
145+
114146
#### save\_relationship\_property
115147

116148
```python
@@ -119,6 +151,12 @@ def save_relationship_property(relationship_id: int, property_name: str, propert
119151

120152
Saves a relationship property to an on disk database.
121153

154+
**Arguments**:
155+
156+
- `relationship_id` - An integer representing the internal id of the relationship.
157+
- `property_name` - A string representing the name of the property.
158+
- `property_value` - A string representing the value of the property.
159+
122160
#### load\_relationship\_property
123161

124162
```python
@@ -127,6 +165,16 @@ def load_relationship_property(relationship_id: int, property_name: str) -> Opti
127165

128166
Loads a relationship property from an on disk database.
129167

168+
**Arguments**:
169+
170+
- `relationship_id` - An integer representing the internal id of the relationship.
171+
- `property_name` - A string representing the name of the property.
172+
173+
174+
**Returns**:
175+
176+
An optional string representing the property value.
177+
130178
#### delete\_relationship\_property
131179

132180
```python
@@ -135,3 +183,8 @@ def delete_relationship_property(relationship_id: int, property_name: str) -> No
135183

136184
Deletes a node property from an on disk database.
137185

186+
**Arguments**:
187+
188+
- `relationship_id` - An integer representing the internal id of the relationship.
189+
- `property_name` - A string representing the name of the property.
190+
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
sidebar_label: instance_runner
3+
title: gqlalchemy.instance_runner
4+
---
5+
6+
#### wait\_for\_port
7+
8+
```python
9+
def wait_for_port(host: str = "127.0.0.1", port: int = 7687, delay: float = 0.01, timeout: float = 5.0) -> None
10+
```
11+
12+
Wait for a TCP port to become available.
13+
14+
**Arguments**:
15+
16+
- `host` - A string representing the IP address that is being checked.
17+
- `port` - A string representing the port that is being checked.
18+
- `delay` - A float that defines how long to wait between retries.
19+
- `timeout` - A float that defines how long to wait for the port.
20+
21+
22+
**Raises**:
23+
24+
- `TimeoutError` - Raises an error when the host and port are not accepting
25+
connections after the timeout period has passed.
26+
27+
#### wait\_for\_docker\_container
28+
29+
```python
30+
def wait_for_docker_container(container: "docker.Container", delay: float = 0.01, timeout: float = 5.0) -> None
31+
```
32+
33+
Wait for a Docker container to enter the status `running`.
34+
35+
**Arguments**:
36+
37+
- `container` - The Docker container to wait for.
38+
- `delay` - A float that defines how long to wait between retries.
39+
- `timeout` - A float that defines how long to wait for the status.
40+
41+
42+
**Raises**:
43+
44+
- `TimeoutError` - Raises an error when the container isn&#x27;t running after the
45+
timeout period has passed.
46+
47+
## MemgraphInstanceBinary Objects
48+
49+
```python
50+
class MemgraphInstanceBinary(MemgraphInstance)
51+
```
52+
53+
A class for managing Memgraph instances started from binary files on Unix
54+
systems.
55+
56+
**Attributes**:
57+
58+
- `binary_path` - A string representing the path to a Memgraph binary
59+
file.
60+
- `user` - A string representing the user that should start the Memgraph
61+
process.
62+
63+
#### start
64+
65+
```python
66+
def start(restart: bool = False) -> "Memgraph"
67+
```
68+
69+
Start the Memgraph instance and return the connection object.
70+
71+
**Attributes**:
72+
73+
- `restart` - A bool indicating if the instance should be
74+
restarted if it&#x27;s already running.
75+
76+
#### stop
77+
78+
```python
79+
def stop() -> int
80+
```
81+
82+
Stop the Memgraph instance.
83+
84+
#### is\_running
85+
86+
```python
87+
def is_running() -> bool
88+
```
89+
90+
Check if the Memgraph instance is still running.
91+
92+
## MemgraphInstanceDocker Objects
93+
94+
```python
95+
class MemgraphInstanceDocker(MemgraphInstance)
96+
```
97+
98+
A class for managing Memgraph instances started in Docker containers.
99+
100+
**Attributes**:
101+
102+
- `docker_image` - An enum representing the Docker image. Values:
103+
`DockerImage.MEMGRAPH` and `DockerImage.MAGE`.
104+
- `docker_image_tag` - A string representing the tag of the Docker image.
105+
106+
#### start
107+
108+
```python
109+
def start(restart: bool = False) -> "Memgraph"
110+
```
111+
112+
Start the Memgraph instance and return the connection object.
113+
114+
**Attributes**:
115+
116+
- `restart` - A bool indicating if the instance should be
117+
restarted if it&#x27;s already running.
118+
119+
#### stop
120+
121+
```python
122+
def stop() -> Dict
123+
```
124+
125+
Stop the Memgraph instance.
126+
127+
#### is\_running
128+
129+
```python
130+
def is_running() -> bool
131+
```
132+
133+
Check if the Memgraph instance is still running.
134+

0 commit comments

Comments
 (0)