python-arango-async 1.2.0__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/PKG-INFO +1 -1
  2. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/aql.py +5 -0
  3. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/collection.py +1 -1
  4. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/typings.py +18 -0
  5. python_arango_async-1.2.2/arangoasync/version.py +1 -0
  6. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/python_arango_async.egg-info/PKG-INFO +1 -1
  7. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/static/cluster-3.12.conf +5 -0
  8. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/static/single-3.12.conf +6 -0
  9. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_aql.py +18 -5
  10. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_collection.py +22 -1
  11. python_arango_async-1.2.0/arangoasync/version.py +0 -1
  12. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/.circleci/config.yml +0 -0
  13. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/.github/workflows/codeql.yaml +0 -0
  14. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/.github/workflows/docs.yaml +0 -0
  15. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/.github/workflows/pypi.yaml +0 -0
  16. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/.gitignore +0 -0
  17. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/.pre-commit-config.yaml +0 -0
  18. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/.readthedocs.yaml +0 -0
  19. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/CONTRIBUTING.md +0 -0
  20. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/LICENSE +0 -0
  21. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/README.md +0 -0
  22. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/__init__.py +0 -0
  23. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/auth.py +0 -0
  24. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/backup.py +0 -0
  25. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/client.py +0 -0
  26. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/cluster.py +0 -0
  27. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/compression.py +0 -0
  28. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/connection.py +0 -0
  29. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/cursor.py +0 -0
  30. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/database.py +0 -0
  31. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/errno.py +0 -0
  32. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/exceptions.py +0 -0
  33. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/executor.py +0 -0
  34. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/foxx.py +0 -0
  35. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/graph.py +0 -0
  36. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/http.py +0 -0
  37. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/job.py +0 -0
  38. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/logger.py +0 -0
  39. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/replication.py +0 -0
  40. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/request.py +0 -0
  41. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/resolver.py +0 -0
  42. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/response.py +0 -0
  43. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/result.py +0 -0
  44. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/arangoasync/serialization.py +0 -0
  45. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/admin.rst +0 -0
  46. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/analyzer.rst +0 -0
  47. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/aql.rst +0 -0
  48. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/async.rst +0 -0
  49. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/authentication.rst +0 -0
  50. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/backup.rst +0 -0
  51. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/certificates.rst +0 -0
  52. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/cluster.rst +0 -0
  53. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/collection.rst +0 -0
  54. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/compression.rst +0 -0
  55. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/conf.py +0 -0
  56. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/cursor.rst +0 -0
  57. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/database.rst +0 -0
  58. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/document.rst +0 -0
  59. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/errno.rst +0 -0
  60. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/errors.rst +0 -0
  61. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/foxx.rst +0 -0
  62. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/graph.rst +0 -0
  63. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/helpers.rst +0 -0
  64. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/http.rst +0 -0
  65. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/index.rst +0 -0
  66. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/indexes.rst +0 -0
  67. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/logging.rst +0 -0
  68. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/migration.rst +0 -0
  69. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/overview.rst +0 -0
  70. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/serialization.rst +0 -0
  71. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/specs.rst +0 -0
  72. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/static/logo.png +0 -0
  73. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/task.rst +0 -0
  74. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/transaction.rst +0 -0
  75. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/user.rst +0 -0
  76. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/docs/view.rst +0 -0
  77. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/pyproject.toml +0 -0
  78. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/python_arango_async.egg-info/SOURCES.txt +0 -0
  79. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/python_arango_async.egg-info/dependency_links.txt +0 -0
  80. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/python_arango_async.egg-info/requires.txt +0 -0
  81. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/python_arango_async.egg-info/top_level.txt +0 -0
  82. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/setup.cfg +0 -0
  83. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/setup.py +0 -0
  84. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/starter.sh +0 -0
  85. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/__init__.py +0 -0
  86. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/conftest.py +0 -0
  87. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/helpers.py +0 -0
  88. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/static/keyfile +0 -0
  89. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/static/service.zip +0 -0
  90. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_analyzer.py +0 -0
  91. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_async.py +0 -0
  92. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_backup.py +0 -0
  93. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_client.py +0 -0
  94. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_cluster.py +0 -0
  95. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_compression.py +0 -0
  96. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_connection.py +0 -0
  97. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_cursor.py +0 -0
  98. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_database.py +0 -0
  99. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_document.py +0 -0
  100. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_foxx.py +0 -0
  101. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_graph.py +0 -0
  102. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_http.py +0 -0
  103. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_resolver.py +0 -0
  104. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_task.py +0 -0
  105. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_transaction.py +0 -0
  106. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_typings.py +0 -0
  107. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_user.py +0 -0
  108. {python_arango_async-1.2.0 → python_arango_async-1.2.2}/tests/test_view.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Async Python Driver for ArangoDB
5
5
  Author-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
6
6
  Maintainer-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
@@ -369,6 +369,7 @@ class AQL:
369
369
  enabled: Optional[bool] = None,
370
370
  max_slow_queries: Optional[int] = None,
371
371
  slow_query_threshold: Optional[int] = None,
372
+ slow_streaming_query_threshold: Optional[int] = None,
372
373
  max_query_string_length: Optional[int] = None,
373
374
  track_bind_vars: Optional[bool] = None,
374
375
  track_slow_queries: Optional[int] = None,
@@ -382,6 +383,8 @@ class AQL:
382
383
  entries are discarded first.
383
384
  slow_query_threshold (int | None): Runtime threshold (in seconds) for treating a
384
385
  query as slow.
386
+ slow_streaming_query_threshold (int | None): Runtime threshold (in seconds) for
387
+ treating a streaming query as slow.
385
388
  max_query_string_length (int | None): The maximum query string length (in bytes)
386
389
  to keep in the list of queries.
387
390
  track_bind_vars (bool | None): If set to `True`, track bind variables used in
@@ -409,6 +412,8 @@ class AQL:
409
412
  data["maxQueryStringLength"] = max_query_string_length
410
413
  if slow_query_threshold is not None:
411
414
  data["slowQueryThreshold"] = slow_query_threshold
415
+ if slow_streaming_query_threshold is not None:
416
+ data["slowStreamingQueryThreshold"] = slow_streaming_query_threshold
412
417
  if track_bind_vars is not None:
413
418
  data["trackBindVars"] = track_bind_vars
414
419
  if track_slow_queries is not None:
@@ -397,7 +397,7 @@ class Collection(Generic[T, U, V]):
397
397
 
398
398
  Args:
399
399
  type (str): Type attribute (ex. "persistent", "inverted", "ttl", "mdi",
400
- "geo").
400
+ "geo", "vector").
401
401
  fields (dict | list): Fields to index.
402
402
  options (dict | None): Additional index options.
403
403
 
@@ -727,6 +727,10 @@ class CollectionProperties(JsonWrapper):
727
727
  def computed_values(self) -> Optional[Json]:
728
728
  return self._data.get("computedValues")
729
729
 
730
+ @property
731
+ def supportsRBAC(self) -> Optional[bool]:
732
+ return self._data.get("supportsRBAC")
733
+
730
734
  @property
731
735
  def object_id(self) -> str:
732
736
  return self._data["objectId"] # type: ignore[no-any-return]
@@ -808,6 +812,8 @@ class CollectionProperties(JsonWrapper):
808
812
  result["computedValues"] = data["computedValues"]
809
813
  if "internalValidatorType" in data:
810
814
  result["internal_validator_type"] = data["internalValidatorType"]
815
+ if "supportsRBAC" in data:
816
+ result["supportsRBAC"] = data["supportsRBAC"]
811
817
  return result
812
818
 
813
819
  def format(self, formatter: Optional[Formatter] = None) -> Json:
@@ -1121,6 +1127,14 @@ class IndexProperties(JsonWrapper):
1121
1127
  def features(self) -> Optional[List[str]]:
1122
1128
  return self._data.get("features")
1123
1129
 
1130
+ @property
1131
+ def error_message(self) -> Optional[str]:
1132
+ return self._data.get("errorMessage")
1133
+
1134
+ @property
1135
+ def training_state(self) -> Optional[str]:
1136
+ return self._data.get("trainingState")
1137
+
1124
1138
  @staticmethod
1125
1139
  def compatibility_formatter(data: Json) -> Json:
1126
1140
  """python-arango compatibility formatter."""
@@ -1179,6 +1193,10 @@ class IndexProperties(JsonWrapper):
1179
1193
  result["writebuffer_max_size"] = data["writebufferSizeMax"]
1180
1194
  if "optimizeTopK" in data:
1181
1195
  result["optimizeTopK"] = data["optimizeTopK"]
1196
+ if "errorMessage" in data:
1197
+ result["error_message"] = data["errorMessage"]
1198
+ if "trainingState" in data:
1199
+ result["training_state"] = data["trainingState"]
1182
1200
  return result
1183
1201
 
1184
1202
  def format(self, formatter: Optional[Formatter] = None) -> Json:
@@ -0,0 +1 @@
1
+ __version__ = "1.2.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Async Python Driver for ArangoDB
5
5
  Author-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
6
6
  Maintainer-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
@@ -9,7 +9,12 @@ jwt-secret = /tests/static/keyfile
9
9
 
10
10
  [args]
11
11
  all.database.password = passwd
12
+ all.vector-index = true
12
13
  all.database.extended-names = true
13
14
  all.log.api-enabled = true
14
15
  all.javascript.allow-admin-execute = true
15
16
  all.server.options-api = admin
17
+ all.javascript.files-allowlist = ".*";
18
+ all.javascript.environment-variables-allowlist = ".*";
19
+ all.javascript.endpoints-allowlist = ".*";
20
+ all.javascript.startup-options-allowlist = ".*";
@@ -8,6 +8,12 @@ jwt-secret = /tests/static/keyfile
8
8
 
9
9
  [args]
10
10
  all.database.password = passwd
11
+ all.vector-index = true
11
12
  all.database.extended-names = true
13
+ all.log.api-enabled = true
12
14
  all.javascript.allow-admin-execute = true
13
15
  all.server.options-api = admin
16
+ all.javascript.files-allowlist = ".*";
17
+ all.javascript.environment-variables-allowlist = ".*";
18
+ all.javascript.endpoints-allowlist = ".*";
19
+ all.javascript.startup-options-allowlist = ".*";
@@ -1,5 +1,6 @@
1
1
  import asyncio
2
2
  import time
3
+ import warnings
3
4
 
4
5
  import pytest
5
6
  from packaging import version
@@ -64,9 +65,16 @@ async def test_query_tracking(db, bad_db):
64
65
  assert tracking.enabled is False
65
66
 
66
67
  # Re-enable.
67
- tracking = await aql.set_tracking(enabled=True, max_slow_queries=5)
68
+ tracking = await aql.set_tracking(
69
+ enabled=True,
70
+ max_slow_queries=5,
71
+ slow_streaming_query_threshold=20,
72
+ slow_query_threshold=15,
73
+ )
68
74
  assert tracking.enabled is True
69
75
  assert tracking.max_slow_queries == 5
76
+ assert tracking.slow_streaming_query_threshold == 20
77
+ assert tracking.slow_query_threshold == 15
70
78
 
71
79
  # Exceptions with bad database
72
80
  with pytest.raises(AQLQueryTrackingGetError):
@@ -131,10 +139,15 @@ async def test_kill_query(db, bad_db, superuser):
131
139
  queries = await aql.queries()
132
140
  if len(queries) > 0:
133
141
  break
134
-
135
- # Kill the query
136
- query_id = queries[0]["id"]
137
- assert await aql.kill(query_id) is True
142
+ time.sleep(1)
143
+
144
+ if len(queries) > 0:
145
+ # Kill the query
146
+ query_id = queries[0]["id"]
147
+ assert await aql.kill(query_id) is True
148
+ else:
149
+ # This test is prone to races
150
+ warnings.warn("Query not found in the list, skipping!")
138
151
 
139
152
  # Ignore missing
140
153
  assert await aql.kill("fakeid", ignore_missing=True) is False
@@ -228,15 +228,36 @@ async def test_collection_index(doc_col, bad_col, cluster):
228
228
  await bad_col.load_indexes()
229
229
  assert err.value.error_code == DATA_SOURCE_NOT_FOUND
230
230
 
231
+ # Create a vector index
232
+ docs = []
233
+ for key in range(100):
234
+ docs.append({"_key": f"key_{key}", "embedding": [1] * 128})
235
+ await doc_col.insert_many(docs)
236
+ idx4 = await doc_col.add_index(
237
+ "vector",
238
+ ["embedding"],
239
+ {
240
+ "name": "vector_index",
241
+ "params": {
242
+ "metric": "cosine",
243
+ "dimension": 128,
244
+ "nLists": 2,
245
+ },
246
+ },
247
+ )
248
+ assert idx4.name == "vector_index"
249
+
231
250
  # Delete indexes
232
- del1, del2, del3 = await asyncio.gather(
251
+ del1, del2, del3, del4 = await asyncio.gather(
233
252
  doc_col.delete_index(idx1.id),
234
253
  doc_col.delete_index(idx2.numeric_id),
235
254
  doc_col.delete_index(str(idx3.numeric_id)),
255
+ doc_col.delete_index(idx4.id),
236
256
  )
237
257
  assert del1 is True
238
258
  assert del2 is True
239
259
  assert del3 is True
260
+ assert del4 is True
240
261
 
241
262
  # Now, the indexes should be gone
242
263
  with pytest.raises(IndexDeleteError) as err:
@@ -1 +0,0 @@
1
- __version__ = "1.2.0"