ivandasch commented on a change in pull request #8203:
URL: https://github.com/apache/ignite/pull/8203#discussion_r480957430
##########
File path: .gitignore
##########
@@ -80,3 +80,9 @@ packages
#NodeJs files
/modules/platforms/nodejs/node_modules
+
+#Python temp files
+**/.eggs
+**/venv
+**/.pytest_cache
+**/pyignite.egg-info
Review comment:
Add new line
##########
File path: modules/platforms/python/tests/test_sql.py
##########
@@ -152,3 +152,71 @@ def test_sql_fields(client):
# repeat cleanup
result = sql_fields(client, 'PUBLIC', drop_query, page_size)
assert result.status == 0
+
+
+def test_long_multipage_query(client):
+ """
+ The test creates a table with 13 columns (id and 12 enumerated columns)
+ and 20 records with id in range from 1 to 20. Values of enumerated columns
+ are = column number * id.
+
+ The goal is to ensure that all the values are selected in a right order.
+ """
+
+ field_range = range(1, 13)
Review comment:
Unnecessary variable definition.
Both of them are used only in one place.
##########
File path: modules/platforms/python/tests/test_sql.py
##########
@@ -152,3 +152,71 @@ def test_sql_fields(client):
# repeat cleanup
result = sql_fields(client, 'PUBLIC', drop_query, page_size)
assert result.status == 0
+
+
+def test_long_multipage_query(client):
+ """
+ The test creates a table with 13 columns (id and 12 enumerated columns)
+ and 20 records with id in range from 1 to 20. Values of enumerated columns
+ are = column number * id.
+
+ The goal is to ensure that all the values are selected in a right order.
+ """
+
+ field_range = range(1, 13)
+
+ record_range = range(1, 21)
+
+ drop_query = 'DROP TABLE LongMultipageQuery IF EXISTS'
+
+ create_query = '''CREATE TABLE LongMultipageQuery (
Review comment:
Both of these queries can be easily created without so long definition:
i.e.
fields = ["id","abc"...]
```
"CREATE TABLE LongMultiPageQuery (%s, %s)" % (fields[0] + " INT(11) PRIMARY
KEY", ",".join(map(lambda f: f + " INT(11)", fields[1:])
"INSERT INTO LongMultipageQuery (%s) VALUES (%s)" % (",".join(fields),
",".join("?" * len(fields)))
```
##########
File path: modules/platforms/python/pyignite/api/sql.py
##########
@@ -442,7 +442,7 @@ def sql_fields_cursor_get_page(
}
for row_dict in value['data']:
row = []
- for field_key in sorted(row_dict.keys()):
+ for field_key in row_dict.keys():
Review comment:
Why not just `row = list(row_dict.values())`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]