Skip to content

Commit 1335fd1

Browse files
isapegoFedor Malchikov
andauthored
GG-35220 Fix examples and documentation (#60)
Co-authored-by: Fedor Malchikov <[email protected]>
1 parent ff3266a commit 1335fd1

28 files changed

+578
-929
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ junit*.xml
1313
pygridgain.egg-info
1414
ignite-log-*
1515
__pycache__
16+
venv

.travis.yml

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

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GridGain
2-
Copyright 2019 GridGain Systems
2+
Copyright 2022 GridGain Systems
33

44
This product includes software developed at
55
The Apache Software Foundation (http://www.apache.org/).

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GridGain Community Edition thin (binary protocol) client, written in Python 3.
55

66
- Python 3.7 or above (3.7, 3.8, 3.9 and 3.10 are tested),
77
- Access to GridGain node, local or remote. The current thin client
8-
version was tested on GridGain CE 8.7 and 8.8 (binary client protocol 1.7.0).
8+
version was tested on GridGain CE 8.7 and 8.8 (binary client protocol 1.7.1).
99

1010
## Installation
1111

@@ -83,7 +83,6 @@ at *RTD* for your convenience.
8383
If you want to build the documentation from source, do the developer
8484
installation as described above, then run the following commands:
8585
```
86-
$ cd <client_root_directory>
8786
$ pip install -r requirements/docs.txt
8887
$ cd docs
8988
$ make html
@@ -103,7 +102,7 @@ installed, and GridGain node is running on localhost:10800.
103102

104103
## Testing
105104
*NB!* It is recommended installing `pygridgain` in development mode.
106-
Refer to [this section](#for-developer) for instructions.
105+
Refer to [this section](#from-sources) for instructions.
107106

108107
Do not forget to install test requirements:
109108
```bash
@@ -113,7 +112,7 @@ $ pip install -r requirements/install.txt -r requirements/tests.txt
113112
Also, you'll need to have a binary release of Ignite with `log4j2` enabled and to set
114113
`IGNITE_HOME` environment variable:
115114
```bash
116-
$ cd <ignite_binary_release>
115+
$ cd <gridgain_binary_release>
117116
$ export IGNITE_HOME=$(pwd)
118117
$ cp -r $IGNITE_HOME/libs/optional/ignite-log4j2 $IGNITE_HOME/libs/
119118
```

docs/async_examples.rst

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Firstly, import dependencies.
3131

3232
.. literalinclude:: ../examples/async_key_value.py
3333
:language: python
34-
:lines: 18
34+
:lines: 19
3535

3636
Let's connect to cluster and perform key-value queries.
3737

3838
.. literalinclude:: ../examples/async_key_value.py
3939
:language: python
4040
:dedent: 4
41-
:lines: 22-37
41+
:lines: 24-47
4242

4343
Scan
4444
====
@@ -48,7 +48,7 @@ that yields the resulting rows.
4848
.. literalinclude:: ../examples/async_key_value.py
4949
:language: python
5050
:dedent: 8
51-
:lines: 39-50
51+
:lines: 49-60
5252

5353
ExpiryPolicy
5454
============
@@ -131,41 +131,44 @@ First let us establish a connection.
131131
.. literalinclude:: ../examples/async_sql.py
132132
:language: python
133133
:dedent: 4
134-
:lines: 197-198
134+
:lines: 25-26
135135

136136
Then create tables. Begin with `Country` table, than proceed with related
137137
tables `City` and `CountryLanguage`.
138138

139-
.. literalinclude:: ../examples/async_sql.py
139+
.. literalinclude:: ../examples/helpers/sql_helper.py
140140
:language: python
141-
:lines: 25-42, 51-59, 67-74
141+
:dedent: 4
142+
:lines: 28-44, 54-61, 69-75
142143

143144
.. literalinclude:: ../examples/async_sql.py
144145
:language: python
145146
:dedent: 4
146-
:lines: 199-205
147+
:lines: 28-33
147148

148149
Create indexes.
149150

150-
.. literalinclude:: ../examples/async_sql.py
151+
.. literalinclude:: ../examples/helpers/sql_helper.py
151152
:language: python
152-
:lines: 60-62, 75-77
153+
:dedent: 4
154+
:lines: 63, 77
153155

154156
.. literalinclude:: ../examples/async_sql.py
155157
:language: python
156158
:dedent: 8
157-
:lines: 207-209
159+
:lines: 36-37
158160

159161
Fill tables with data.
160162

161-
.. literalinclude:: ../examples/async_sql.py
163+
.. literalinclude:: ../examples/helpers/sql_helper.py
162164
:language: python
163-
:lines: 43-50, 63-66, 78-81
165+
:dedent: 4
166+
:lines: 46-52, 65-67, 79-81
164167

165168
.. literalinclude:: ../examples/async_sql.py
166169
:language: python
167170
:dedent: 8
168-
:lines: 212-223
171+
:lines: 40-50
169172

170173
Now let us answer some questions.
171174

@@ -175,7 +178,7 @@ What are the 10 largest cities in our data sample (population-wise)?
175178
.. literalinclude:: ../examples/async_sql.py
176179
:language: python
177180
:dedent: 8
178-
:lines: 225-243
181+
:lines: 53-67
179182

180183
The :py:meth:`~pygridgain.aio_client.AioClient.sql` method returns :py:class:`~pygridgain.cursors.AioSqlFieldsCursor`,
181184
that yields the resulting rows.
@@ -192,26 +195,27 @@ of :py:class:`~pygridgain.cursors.AioSqlFieldsCursor`
192195
.. literalinclude:: ../examples/async_sql.py
193196
:language: python
194197
:dedent: 8
195-
:lines: 246-271
198+
:lines: 70-96
196199

197200
Display all the information about a given city
198201
==============================================
199202

200203
.. literalinclude:: ../examples/async_sql.py
201204
:language: python
202205
:dedent: 8
203-
:lines: 273-288
206+
:lines: 99-111
204207

205208
Finally, delete the tables used in this example with the following queries:
206209

207-
.. literalinclude:: ../examples/async_sql.py
210+
.. literalinclude:: ../examples/helpers/sql_helper.py
208211
:language: python
212+
:dedent: 4
209213
:lines: 83
210214

211215
.. literalinclude:: ../examples/async_sql.py
212216
:language: python
213217
:dedent: 8
214-
:lines: 290-297
218+
:lines: 114-116
215219

216220

217221

0 commit comments

Comments
 (0)