Skip to content

Commit d5d867c

Browse files
authored
update arangodb matrix (#334)
* update arangodb matrix * docs: update ADB version * drop 3.10 from CI * remove `version.parse` for 3.10 & 3.11
1 parent dd0be28 commit d5d867c

12 files changed

+35
-79
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ workflows:
1515
python_version: ["3.8", "3.9", "3.10", "3.11"] # "3.12"
1616
arangodb_config: ["single", "cluster"]
1717
arangodb_license: ["community", "enterprise"]
18-
arangodb_version: ["3.10.10", "3.11.4", "latest"]
18+
arangodb_version: ["3.11", "latest"]
1919

2020
jobs:
2121
lint:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ database natively supporting documents, graphs and search.
2121

2222
## Requirements
2323

24-
- ArangoDB version 3.9+
24+
- ArangoDB version 3.11+
2525
- Python version 3.8+
2626

2727
## Installation

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Welcome to the documentation for **python-arango**, a Python driver for ArangoDB
1010
Requirements
1111
=============
1212

13-
- ArangoDB version 3.9+
13+
- ArangoDB version 3.11+
1414
- Python version 3.8+
1515

1616
Installation

tests/test_analyzer.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from packaging import version
2-
31
from arango.exceptions import (
42
AnalyzerCreateError,
53
AnalyzerDeleteError,
@@ -9,7 +7,7 @@
97
from tests.helpers import assert_raises, generate_analyzer_name
108

119

12-
def test_analyzer_management(db, bad_db, cluster, enterprise, db_version):
10+
def test_analyzer_management(db, bad_db, cluster, enterprise):
1311
analyzer_name = generate_analyzer_name()
1412
full_analyzer_name = db.name + "::" + analyzer_name
1513
bad_analyzer_name = generate_analyzer_name()
@@ -60,7 +58,7 @@ def test_analyzer_management(db, bad_db, cluster, enterprise, db_version):
6058
assert db.delete_analyzer(analyzer_name, ignore_missing=True) is False
6159

6260
# Test create geo_s2 analyzer (EE only)
63-
if enterprise and db_version >= version.parse("3.10.5"):
61+
if enterprise:
6462
analyzer_name = generate_analyzer_name()
6563
result = db.create_analyzer(analyzer_name, "geo_s2", {})
6664
assert result["type"] == "geo_s2"

tests/test_aql.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ def test_aql_query_management(db_version, db, bad_db, col, docs):
199199
assert "state" in query
200200
assert "bind_vars" in query
201201
assert "runtime" in query
202-
if db_version >= version.parse("3.11"):
203-
assert "peak_memory_usage" in query
202+
assert "peak_memory_usage" in query
204203
assert len(queries) == 2
205204

206205
# Test list queries with bad database
@@ -247,7 +246,7 @@ def test_aql_query_management(db_version, db, bad_db, col, docs):
247246

248247

249248
def test_aql_query_force_one_shard_attribute_value(db, db_version, enterprise, cluster):
250-
if db_version < version.parse("3.10") or not enterprise or not cluster:
249+
if not enterprise or not cluster:
251250
return
252251

253252
name = generate_col_name()

tests/test_cluster.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import warnings
33

44
import pytest
5-
from packaging import version
65

76
from arango.errno import DATABASE_NOT_FOUND, FORBIDDEN
87
from arango.exceptions import (
@@ -185,13 +184,10 @@ def test_cluster_server_count(db, bad_db, cluster):
185184
assert err.value.error_code in {FORBIDDEN, DATABASE_NOT_FOUND}
186185

187186

188-
def test_cluster_rebalance(sys_db, bad_db, cluster, db_version):
187+
def test_cluster_rebalance(sys_db, bad_db, cluster):
189188
if not cluster:
190189
pytest.skip("Only tested in a cluster setup")
191190

192-
if db_version < version.parse("3.10.0"):
193-
pytest.skip("Only tested on ArangoDB 3.10+")
194-
195191
# Test imbalance retrieval
196192
imbalance = sys_db.cluster.calculate_imbalance()
197193
assert "leader" in imbalance

tests/test_collection.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
from packaging import version
32

43
from arango.client import ArangoClient
54
from arango.collection import StandardCollection
@@ -316,21 +315,15 @@ def special_db_names(sys_db):
316315
pass
317316

318317

319-
def test_collection_utf8(db, db_version, special_collection_names):
320-
if db_version < version.parse("3.11.0"):
321-
pytest.skip("UTF8 collection names require ArangoDB 3.11+")
322-
318+
def test_collection_utf8(db, special_collection_names):
323319
for name in special_collection_names:
324320
create_and_delete_collection(db, name)
325321

326322

327323
# Not sure if this belongs in here or in `test_database.py`...
328324
def test_database_and_collection_utf8(
329-
sys_db, db_version, special_collection_names, special_db_names
325+
sys_db, special_collection_names, special_db_names
330326
):
331-
if db_version < version.parse("3.11.0"):
332-
pytest.skip("UTF8 collection names require ArangoDB 3.11+")
333-
334327
client = ArangoClient(hosts="http://127.0.0.1:8529")
335328
for db_name in special_db_names:
336329
username = generate_username()

tests/test_cursor.py

+16-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
from packaging import version
32

43
from arango.exceptions import (
54
CursorCloseError,
@@ -263,7 +262,7 @@ def test_cursor_manual_fetch_and_pop(db, col, docs):
263262
assert err.value.message == "current batch is empty"
264263

265264

266-
def test_cursor_retry_disabled(db, col, docs, db_version):
265+
def test_cursor_retry_disabled(db, col, docs):
267266
cursor = db.aql.execute(
268267
f"FOR d IN {col.name} SORT d._key RETURN d",
269268
count=True,
@@ -282,8 +281,7 @@ def test_cursor_retry_disabled(db, col, docs, db_version):
282281
# The next batch ID should have no effect
283282
cursor._next_batch_id = "2"
284283
result = cursor.fetch()
285-
if db_version >= version.parse("3.11.1"):
286-
assert result["next_batch_id"] == "4"
284+
assert result["next_batch_id"] == "4"
287285
doc = cursor.pop()
288286
assert clean_doc(doc) == docs[2]
289287

@@ -308,28 +306,25 @@ def test_cursor_retry(db, col, docs, db_version):
308306

309307
result = cursor.fetch()
310308
assert result["id"] == cursor.id
311-
if db_version >= version.parse("3.11.0"):
312-
assert result["next_batch_id"] == "3"
309+
assert result["next_batch_id"] == "3"
313310
doc = cursor.pop()
314311
assert clean_doc(doc) == docs[1]
315312
assert cursor.empty()
316313

317314
# Decrease the next batch ID as if the previous fetch failed
318-
if db_version >= version.parse("3.11.0"):
319-
cursor._next_batch_id = "2"
320-
result = cursor.fetch()
321-
assert result["id"] == cursor.id
322-
assert result["next_batch_id"] == "3"
323-
doc = cursor.pop()
324-
assert clean_doc(doc) == docs[1]
325-
assert cursor.empty()
315+
cursor._next_batch_id = "2"
316+
result = cursor.fetch()
317+
assert result["id"] == cursor.id
318+
assert result["next_batch_id"] == "3"
319+
doc = cursor.pop()
320+
assert clean_doc(doc) == docs[1]
321+
assert cursor.empty()
326322

327323
# Fetch the next batches normally
328324
for batch in range(2, 5):
329325
result = cursor.fetch()
330326
assert result["id"] == cursor.id
331-
if db_version >= version.parse("3.11.0"):
332-
assert result["next_batch_id"] == str(batch + 2)
327+
assert result["next_batch_id"] == str(batch + 2)
333328
doc = cursor.pop()
334329
assert clean_doc(doc) == docs[batch]
335330

@@ -340,17 +335,12 @@ def test_cursor_retry(db, col, docs, db_version):
340335
doc = cursor.pop()
341336
assert clean_doc(doc) == docs[-1]
342337

343-
if db_version >= version.parse("3.11.0"):
344-
# We should be able to fetch the last batch again
345-
cursor.fetch()
346-
doc = cursor.pop()
347-
assert clean_doc(doc) == docs[-1]
338+
# We should be able to fetch the last batch again
339+
cursor.fetch()
340+
doc = cursor.pop()
341+
assert clean_doc(doc) == docs[-1]
348342

349-
if db_version >= version.parse("3.11.0"):
350-
assert cursor.close()
351-
else:
352-
with pytest.raises(CursorCloseError):
353-
cursor.close()
343+
assert cursor.close()
354344

355345

356346
def test_cursor_no_count(db, col):

tests/test_database.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from datetime import datetime
22

33
import pytest
4-
from packaging import version
54

65
from arango.aql import AQL
76
from arango.backup import Backup
@@ -416,10 +415,7 @@ def special_db_names(sys_db):
416415
pass
417416

418417

419-
def test_database_utf8(sys_db, db_version, special_db_names):
420-
if db_version < version.parse("3.11.0"):
421-
pytest.skip("UTF8 collection names require ArangoDB 3.11+")
422-
418+
def test_database_utf8(sys_db, special_db_names):
423419
for name in special_db_names:
424420
assert sys_db.create_database(name)
425421
assert sys_db.has_database(name)

tests/test_index.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,7 @@ def test_add_ttl_index(icol):
220220
icol.delete_index(result["id"])
221221

222222

223-
def test_add_inverted_index(icol, enterprise, db_version):
224-
if db_version < version.parse("3.10.0"):
225-
pytest.skip("Inverted indexes are not supported before 3.10.0")
226-
223+
def test_add_inverted_index(icol, enterprise):
227224
parameters = dict(
228225
fields=[{"name": "attr1", "cache": True}],
229226
name="c0_cached",
@@ -234,7 +231,7 @@ def test_add_inverted_index(icol, enterprise, db_version):
234231
)
235232
expected_keys = ["primary_sort", "analyzer", "include_all_fields", "search_field"]
236233

237-
if enterprise and db_version >= version.parse("3.10.2"):
234+
if enterprise:
238235
parameters["cache"] = True
239236
parameters["primaryKeyCache"] = True
240237
expected_keys.extend(["cache", "primaryKeyCache"])

tests/test_pregel.py

+3-12
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
import pytest
44
from packaging import version
55

6-
from arango.exceptions import (
7-
PregelJobCreateError,
8-
PregelJobDeleteError,
9-
PregelJobGetError,
10-
)
6+
from arango.exceptions import PregelJobCreateError, PregelJobDeleteError
117
from tests.helpers import assert_raises, generate_string
128

139

@@ -58,13 +54,8 @@ def test_pregel_management(db, db_version, graph, cluster):
5854
# Test delete existing pregel job
5955
assert db.pregel.delete_job(job_id) is True
6056
time.sleep(0.2)
61-
if db_version < version.parse("3.11.0"):
62-
with assert_raises(PregelJobGetError) as err:
63-
db.pregel.job(job_id)
64-
assert err.value.error_code in {4, 10, 1600}
65-
else:
66-
job = db.pregel.job(job_id)
67-
assert job["state"] == "canceled"
57+
job = db.pregel.job(job_id)
58+
assert job["state"] == "canceled"
6859

6960
# Test delete missing pregel job
7061
with assert_raises(PregelJobDeleteError) as err:

tests/test_view.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from packaging import version
2-
31
from arango.exceptions import (
42
ViewCreateError,
53
ViewDeleteError,
@@ -180,7 +178,7 @@ def test_arangosearch_view_management(db, bad_db, cluster):
180178
assert db.delete_view(view_name, ignore_missing=False) is True
181179

182180

183-
def test_arangosearch_view_properties(db, col, enterprise, db_version):
181+
def test_arangosearch_view_properties(db, col, enterprise):
184182
view_name = generate_view_name()
185183
params = {"consolidationIntervalMsec": 50000}
186184

@@ -199,10 +197,8 @@ def test_arangosearch_view_properties(db, col, enterprise, db_version):
199197
}
200198
)
201199

202-
if db_version >= version.parse("3.9.6"):
203-
params.update({"primarySortCache": True, "primaryKeyCache": True})
204-
if db_version >= version.parse("3.10.3"):
205-
params.update({"storedValues": ["attr1", "attr2"]})
200+
params.update({"primarySortCache": True, "primaryKeyCache": True})
201+
params.update({"storedValues": ["attr1", "attr2"]})
206202

207203
result = db.create_arangosearch_view(view_name, properties=params)
208204
assert "id" in result

0 commit comments

Comments
 (0)