python-arango-async 1.0.6__tar.gz → 1.2.0__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.0.6 → python_arango_async-1.2.0}/.pre-commit-config.yaml +1 -1
  2. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/PKG-INFO +4 -4
  3. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/auth.py +1 -1
  4. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/collection.py +10 -3
  5. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/database.py +2 -0
  6. python_arango_async-1.2.0/arangoasync/version.py +1 -0
  7. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/pyproject.toml +4 -3
  8. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/python_arango_async.egg-info/PKG-INFO +4 -4
  9. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/python_arango_async.egg-info/requires.txt +3 -3
  10. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_backup.py +6 -0
  11. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_collection.py +2 -0
  12. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_database.py +2 -0
  13. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_document.py +3 -4
  14. python_arango_async-1.0.6/arangoasync/version.py +0 -1
  15. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/.circleci/config.yml +0 -0
  16. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/.github/workflows/codeql.yaml +0 -0
  17. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/.github/workflows/docs.yaml +0 -0
  18. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/.github/workflows/pypi.yaml +0 -0
  19. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/.gitignore +0 -0
  20. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/.readthedocs.yaml +0 -0
  21. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/CONTRIBUTING.md +0 -0
  22. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/LICENSE +0 -0
  23. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/README.md +0 -0
  24. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/__init__.py +0 -0
  25. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/aql.py +0 -0
  26. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/backup.py +0 -0
  27. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/client.py +0 -0
  28. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/cluster.py +0 -0
  29. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/compression.py +0 -0
  30. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/connection.py +0 -0
  31. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/cursor.py +0 -0
  32. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/errno.py +0 -0
  33. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/exceptions.py +0 -0
  34. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/executor.py +0 -0
  35. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/foxx.py +0 -0
  36. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/graph.py +0 -0
  37. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/http.py +0 -0
  38. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/job.py +0 -0
  39. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/logger.py +0 -0
  40. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/replication.py +0 -0
  41. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/request.py +0 -0
  42. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/resolver.py +0 -0
  43. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/response.py +0 -0
  44. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/result.py +0 -0
  45. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/serialization.py +0 -0
  46. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/arangoasync/typings.py +0 -0
  47. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/admin.rst +0 -0
  48. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/analyzer.rst +0 -0
  49. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/aql.rst +0 -0
  50. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/async.rst +0 -0
  51. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/authentication.rst +0 -0
  52. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/backup.rst +0 -0
  53. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/certificates.rst +0 -0
  54. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/cluster.rst +0 -0
  55. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/collection.rst +0 -0
  56. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/compression.rst +0 -0
  57. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/conf.py +0 -0
  58. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/cursor.rst +0 -0
  59. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/database.rst +0 -0
  60. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/document.rst +0 -0
  61. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/errno.rst +0 -0
  62. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/errors.rst +0 -0
  63. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/foxx.rst +0 -0
  64. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/graph.rst +0 -0
  65. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/helpers.rst +0 -0
  66. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/http.rst +0 -0
  67. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/index.rst +0 -0
  68. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/indexes.rst +0 -0
  69. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/logging.rst +0 -0
  70. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/migration.rst +0 -0
  71. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/overview.rst +0 -0
  72. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/serialization.rst +0 -0
  73. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/specs.rst +0 -0
  74. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/static/logo.png +0 -0
  75. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/task.rst +0 -0
  76. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/transaction.rst +0 -0
  77. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/user.rst +0 -0
  78. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/docs/view.rst +0 -0
  79. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/python_arango_async.egg-info/SOURCES.txt +0 -0
  80. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/python_arango_async.egg-info/dependency_links.txt +0 -0
  81. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/python_arango_async.egg-info/top_level.txt +0 -0
  82. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/setup.cfg +0 -0
  83. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/setup.py +0 -0
  84. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/starter.sh +0 -0
  85. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/__init__.py +0 -0
  86. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/conftest.py +0 -0
  87. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/helpers.py +0 -0
  88. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/static/cluster-3.12.conf +0 -0
  89. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/static/keyfile +0 -0
  90. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/static/service.zip +0 -0
  91. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/static/single-3.12.conf +0 -0
  92. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_analyzer.py +0 -0
  93. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_aql.py +0 -0
  94. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_async.py +0 -0
  95. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_client.py +0 -0
  96. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_cluster.py +0 -0
  97. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_compression.py +0 -0
  98. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_connection.py +0 -0
  99. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_cursor.py +0 -0
  100. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_foxx.py +0 -0
  101. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_graph.py +0 -0
  102. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_http.py +0 -0
  103. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_resolver.py +0 -0
  104. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_task.py +0 -0
  105. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_transaction.py +0 -0
  106. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_typings.py +0 -0
  107. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_user.py +0 -0
  108. {python_arango_async-1.0.6 → python_arango_async-1.2.0}/tests/test_view.py +0 -0
@@ -34,7 +34,7 @@ repos:
34
34
  - id: flake8
35
35
 
36
36
  - repo: https://github.com/pre-commit/mirrors-mypy
37
- rev: v1.10.0
37
+ rev: v1.15.0
38
38
  hooks:
39
39
  - id: mypy
40
40
  files: ^arangoasync/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.0.6
3
+ Version: 1.2.0
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>
@@ -23,13 +23,13 @@ License-File: LICENSE
23
23
  Requires-Dist: packaging>=23.1
24
24
  Requires-Dist: aiohttp>=3.9
25
25
  Requires-Dist: multidict>=6.0
26
- Requires-Dist: pyjwt>=2.8.0
26
+ Requires-Dist: pyjwt>=2.10.0
27
27
  Provides-Extra: dev
28
28
  Requires-Dist: aiofiles>=24.1.0; extra == "dev"
29
29
  Requires-Dist: black==26.1.0; extra == "dev"
30
30
  Requires-Dist: flake8==7.3.0; extra == "dev"
31
- Requires-Dist: isort>=5.10; extra == "dev"
32
- Requires-Dist: mypy>=1.10; extra == "dev"
31
+ Requires-Dist: isort>=5.10.1; extra == "dev"
32
+ Requires-Dist: mypy==1.15.0; extra == "dev"
33
33
  Requires-Dist: pre-commit>=3.7; extra == "dev"
34
34
  Requires-Dist: pytest>=8.2; extra == "dev"
35
35
  Requires-Dist: pytest-asyncio>=0.23.8; extra == "dev"
@@ -115,7 +115,7 @@ class JwtToken:
115
115
  "verify_iat": True,
116
116
  "verify_exp": True,
117
117
  "verify_signature": False,
118
- },
118
+ }, # type: ignore[arg-type]
119
119
  )
120
120
 
121
121
  self._token_exp = jwt_payload["exp"]
@@ -570,6 +570,7 @@ class Collection(Generic[T, U, V]):
570
570
 
571
571
  Raises:
572
572
  CollectionConfigureError: If configuration fails.
573
+ ValueError: If parameters are invalid.
573
574
 
574
575
  References:
575
576
  - `change-the-properties-of-a-collection <https://docs.arango.ai/arangodb/stable/develop/http-api/collections/#change-the-properties-of-a-collection>`__
@@ -582,6 +583,8 @@ class Collection(Generic[T, U, V]):
582
583
  if replication_factor is not None:
583
584
  data["replicationFactor"] = replication_factor
584
585
  if schema is not None:
586
+ if not isinstance(schema, dict) or len(schema) == 0:
587
+ raise ValueError("schema parameter must be a non-empty dict")
585
588
  data["schema"] = schema
586
589
  if wait_for_sync is not None:
587
590
  data["waitForSync"] = wait_for_sync
@@ -934,7 +937,7 @@ class Collection(Generic[T, U, V]):
934
937
  documents: Sequence[str | T],
935
938
  allow_dirty_read: Optional[bool] = None,
936
939
  ignore_revs: Optional[bool] = None,
937
- ) -> Result[V]:
940
+ ) -> Result[Jsons]:
938
941
  """Return multiple documents ignoring any missing ones.
939
942
 
940
943
  Args:
@@ -977,10 +980,14 @@ class Collection(Generic[T, U, V]):
977
980
  data=self._doc_serializer.dumps(documents),
978
981
  )
979
982
 
980
- def response_handler(resp: Response) -> V:
983
+ def response_handler(resp: Response) -> Jsons:
981
984
  if not resp.is_success:
982
985
  raise DocumentGetError(resp, request)
983
- return self._doc_deserializer.loads_many(resp.raw_body)
986
+ return [
987
+ doc
988
+ for doc in self.deserializer.loads_many(resp.raw_body)
989
+ if "_id" in doc
990
+ ]
984
991
 
985
992
  return await self._executor.execute(request, response_handler)
986
993
 
@@ -694,6 +694,8 @@ class Database:
694
694
  key_options.validate()
695
695
  data["keyOptions"] = key_options.to_dict()
696
696
  if schema is not None:
697
+ if not isinstance(schema, dict) or len(schema) == 0:
698
+ raise ValueError("schema parameter must be a non-empty dict")
697
699
  data["schema"] = schema
698
700
  if shard_keys is not None:
699
701
  data["shardKeys"] = shard_keys
@@ -0,0 +1 @@
1
+ __version__ = "1.2.0"
@@ -40,7 +40,7 @@ dependencies = [
40
40
  "packaging>=23.1",
41
41
  "aiohttp>=3.9",
42
42
  "multidict>=6.0",
43
- "pyjwt>=2.8.0",
43
+ "pyjwt>=2.10.0",
44
44
  ]
45
45
 
46
46
  [tool.setuptools.dynamic]
@@ -51,8 +51,8 @@ dev = [
51
51
  "aiofiles>=24.1.0",
52
52
  "black==26.1.0",
53
53
  "flake8==7.3.0",
54
- "isort>=5.10",
55
- "mypy>=1.10",
54
+ "isort>=5.10.1",
55
+ "mypy==1.15.0",
56
56
  "pre-commit>=3.7",
57
57
  "pytest>=8.2",
58
58
  "pytest-asyncio>=0.23.8",
@@ -92,5 +92,6 @@ profile = "black"
92
92
  [tool.mypy]
93
93
  warn_return_any = true
94
94
  warn_unused_configs = true
95
+ warn_unused_ignores = false
95
96
  ignore_missing_imports = true
96
97
  strict = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.0.6
3
+ Version: 1.2.0
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>
@@ -23,13 +23,13 @@ License-File: LICENSE
23
23
  Requires-Dist: packaging>=23.1
24
24
  Requires-Dist: aiohttp>=3.9
25
25
  Requires-Dist: multidict>=6.0
26
- Requires-Dist: pyjwt>=2.8.0
26
+ Requires-Dist: pyjwt>=2.10.0
27
27
  Provides-Extra: dev
28
28
  Requires-Dist: aiofiles>=24.1.0; extra == "dev"
29
29
  Requires-Dist: black==26.1.0; extra == "dev"
30
30
  Requires-Dist: flake8==7.3.0; extra == "dev"
31
- Requires-Dist: isort>=5.10; extra == "dev"
32
- Requires-Dist: mypy>=1.10; extra == "dev"
31
+ Requires-Dist: isort>=5.10.1; extra == "dev"
32
+ Requires-Dist: mypy==1.15.0; extra == "dev"
33
33
  Requires-Dist: pre-commit>=3.7; extra == "dev"
34
34
  Requires-Dist: pytest>=8.2; extra == "dev"
35
35
  Requires-Dist: pytest-asyncio>=0.23.8; extra == "dev"
@@ -1,14 +1,14 @@
1
1
  packaging>=23.1
2
2
  aiohttp>=3.9
3
3
  multidict>=6.0
4
- pyjwt>=2.8.0
4
+ pyjwt>=2.10.0
5
5
 
6
6
  [dev]
7
7
  aiofiles>=24.1.0
8
8
  black==26.1.0
9
9
  flake8==7.3.0
10
- isort>=5.10
11
- mypy>=1.10
10
+ isort>=5.10.1
11
+ mypy==1.15.0
12
12
  pre-commit>=3.7
13
13
  pytest>=8.2
14
14
  pytest-asyncio>=0.23.8
@@ -1,3 +1,5 @@
1
+ import asyncio
2
+
1
3
  import pytest
2
4
  from packaging import version
3
5
 
@@ -36,6 +38,10 @@ async def test_backup(
36
38
  assert "list" in result
37
39
  result = await backup.restore(backup_id)
38
40
  assert "previous" in result
41
+
42
+ # Wait for restore to complete
43
+ await asyncio.sleep(10)
44
+
39
45
  config = {"local": {"type": "local"}}
40
46
  result = await backup.upload(backup_id, repository=backup_path, config=config)
41
47
  assert "uploadId" in result
@@ -50,6 +50,8 @@ async def test_collection_misc_methods(doc_col, bad_col, docs, cluster):
50
50
  assert new_properties.wait_for_sync == wfs
51
51
  with pytest.raises(CollectionConfigureError):
52
52
  await bad_col.configure(wait_for_sync=wfs)
53
+ with pytest.raises(ValueError):
54
+ await doc_col.configure(schema={})
53
55
 
54
56
  # Statistics
55
57
  statistics = await doc_col.statistics()
@@ -352,6 +352,8 @@ async def test_create_drop_collection(db, bad_db, cluster):
352
352
  await db.create_collection(generate_col_name(), col_type=db)
353
353
  with pytest.raises(ValueError):
354
354
  await db.create_collection(generate_col_name(), key_options={})
355
+ with pytest.raises(ValueError):
356
+ await db.create_collection(generate_col_name(), schema={})
355
357
 
356
358
  # Drop the newly created collection
357
359
  assert await db.delete_collection(col_name) is True
@@ -223,8 +223,8 @@ async def test_document_get_many(doc_col, bad_col, docs):
223
223
  keys = [doc["_key"] for doc in docs]
224
224
  keys.append("invalid_key")
225
225
  many = await doc_col.get_many(keys)
226
- assert len(many) == len(keys)
227
- assert "error" in many[-1]
226
+ assert len(many) == len(keys) - 1
227
+ assert "error" not in many[-1]
228
228
 
229
229
  # Test with full documents
230
230
  many = await doc_col.get_many(docs)
@@ -237,8 +237,7 @@ async def test_document_get_many(doc_col, bad_col, docs):
237
237
  assert len(many) == 1
238
238
  assert "error" not in many[0]
239
239
  many = await doc_col.get_many([bad_rev[0]], ignore_revs=False)
240
- assert len(many) == 1
241
- assert "error" in many[0]
240
+ assert len(many) == 0
242
241
 
243
242
  # Empty list
244
243
  many = await doc_col.get_many([])
@@ -1 +0,0 @@
1
- __version__ = "1.0.6"