python-arango-async 1.2.6__tar.gz → 1.2.7__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 (114) hide show
  1. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/.circleci/config.yml +2 -9
  2. {python_arango_async-1.2.6/python_arango_async.egg-info → python_arango_async-1.2.7}/PKG-INFO +1 -1
  3. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/database.py +26 -10
  4. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/graph.py +3 -2
  5. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/typings.py +28 -0
  6. python_arango_async-1.2.7/arangoasync/version.py +1 -0
  7. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/graph.rst +39 -0
  8. {python_arango_async-1.2.6 → python_arango_async-1.2.7/python_arango_async.egg-info}/PKG-INFO +1 -1
  9. python_arango_async-1.2.7/python_arango_async.egg-info/scm_version.json +8 -0
  10. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_aql.py +2 -2
  11. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_graph.py +78 -2
  12. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_typings.py +23 -0
  13. python_arango_async-1.2.6/arangoasync/version.py +0 -1
  14. python_arango_async-1.2.6/python_arango_async.egg-info/scm_version.json +0 -8
  15. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/.github/workflows/codeql.yaml +0 -0
  16. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/.github/workflows/docs.yaml +0 -0
  17. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/.github/workflows/pypi.yaml +0 -0
  18. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/.gitignore +0 -0
  19. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/.pre-commit-config.yaml +0 -0
  20. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/.readthedocs.yaml +0 -0
  21. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/AGENTS.md +0 -0
  22. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/LICENSE +0 -0
  23. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/README.md +0 -0
  24. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/__init__.py +0 -0
  25. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/aql.py +0 -0
  26. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/auth.py +0 -0
  27. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/backup.py +0 -0
  28. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/client.py +0 -0
  29. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/cluster.py +0 -0
  30. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/collection.py +0 -0
  31. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/compression.py +0 -0
  32. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/connection.py +0 -0
  33. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/cursor.py +0 -0
  34. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/errno.py +0 -0
  35. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/exceptions.py +0 -0
  36. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/executor.py +0 -0
  37. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/foxx.py +0 -0
  38. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/http.py +0 -0
  39. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/job.py +0 -0
  40. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/logger.py +0 -0
  41. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/replication.py +0 -0
  42. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/request.py +0 -0
  43. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/resolver.py +0 -0
  44. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/response.py +0 -0
  45. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/result.py +0 -0
  46. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/arangoasync/serialization.py +0 -0
  47. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/admin.rst +0 -0
  48. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/analyzer.rst +0 -0
  49. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/aql.rst +0 -0
  50. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/async.rst +0 -0
  51. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/authentication.rst +0 -0
  52. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/backup.rst +0 -0
  53. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/certificates.rst +0 -0
  54. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/cluster.rst +0 -0
  55. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/collection.rst +0 -0
  56. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/compression.rst +0 -0
  57. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/conf.py +0 -0
  58. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/cursor.rst +0 -0
  59. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/database.rst +0 -0
  60. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/document.rst +0 -0
  61. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/errno.rst +0 -0
  62. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/errors.rst +0 -0
  63. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/foxx.rst +0 -0
  64. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/helpers.rst +0 -0
  65. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/http.rst +0 -0
  66. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/index.rst +0 -0
  67. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/indexes.rst +0 -0
  68. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/logging.rst +0 -0
  69. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/migration.rst +0 -0
  70. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/overview.rst +0 -0
  71. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/serialization.rst +0 -0
  72. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/specs.rst +0 -0
  73. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/static/logo.png +0 -0
  74. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/task.rst +0 -0
  75. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/transaction.rst +0 -0
  76. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/user.rst +0 -0
  77. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/docs/view.rst +0 -0
  78. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/pyproject.toml +0 -0
  79. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/python_arango_async.egg-info/SOURCES.txt +0 -0
  80. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/python_arango_async.egg-info/dependency_links.txt +0 -0
  81. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/python_arango_async.egg-info/requires.txt +0 -0
  82. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/python_arango_async.egg-info/scm_file_list.json +0 -0
  83. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/python_arango_async.egg-info/top_level.txt +0 -0
  84. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/setup.cfg +0 -0
  85. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/setup.py +0 -0
  86. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/starter.sh +0 -0
  87. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/__init__.py +0 -0
  88. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/conftest.py +0 -0
  89. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/helpers.py +0 -0
  90. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/static/cluster-3.12.conf +0 -0
  91. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/static/cluster-4.0.conf +0 -0
  92. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/static/keyfile +0 -0
  93. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/static/service.zip +0 -0
  94. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/static/single-3.12.conf +0 -0
  95. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/static/single-4.0.conf +0 -0
  96. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_analyzer.py +0 -0
  97. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_async.py +0 -0
  98. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_backup.py +0 -0
  99. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_client.py +0 -0
  100. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_cluster.py +0 -0
  101. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_collection.py +0 -0
  102. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_compression.py +0 -0
  103. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_connection.py +0 -0
  104. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_cursor.py +0 -0
  105. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_database.py +0 -0
  106. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_document.py +0 -0
  107. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_foxx.py +0 -0
  108. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_http.py +0 -0
  109. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_imports.py +0 -0
  110. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_resolver.py +0 -0
  111. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_task.py +0 -0
  112. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_transaction.py +0 -0
  113. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_user.py +0 -0
  114. {python_arango_async-1.2.6 → python_arango_async-1.2.7}/tests/test_view.py +0 -0
@@ -29,13 +29,6 @@ workflows:
29
29
  matrix:
30
30
  parameters:
31
31
  python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
32
- - integration-test:
33
- name: ArangoDB (enterprise, 3.12.10 << matrix.arangodb_config >>)
34
- matrix:
35
- parameters:
36
- arangodb_config: ["single", "cluster"]
37
- arangodb_image: ["arangodb/enterprise:3.12.10"]
38
- arangodb_conf_version: ["3.12"]
39
32
  - integration-test:
40
33
  name: ArangoDB (enterprise, 3.12.9 << matrix.arangodb_config >>)
41
34
  matrix:
@@ -51,11 +44,11 @@ workflows:
51
44
  arangodb_image: [ "arangodb/core-preview:4.0-nightly" ]
52
45
  arangodb_conf_version: [ "4.0" ]
53
46
  - integration-test:
54
- name: ArangoDB (enterprise-preview, 3.12-nightly << matrix.arangodb_config >>)
47
+ name: ArangoDB (enterprise, 3.12-latest << matrix.arangodb_config >>)
55
48
  matrix:
56
49
  parameters:
57
50
  arangodb_config: ["single", "cluster"]
58
- arangodb_image: ["arangodb/enterprise-preview:3.12-nightly"]
51
+ arangodb_image: ["arangodb/enterprise:3.12"]
59
52
  arangodb_conf_version: ["3.12"]
60
53
 
61
54
  jobs:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.2.6
3
+ Version: 1.2.7
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>
@@ -1240,11 +1240,18 @@ class Database:
1240
1240
  edge collection), "from" (list of vertex collection names) and "to"
1241
1241
  (list of vertex collection names).
1242
1242
  is_disjoint (bool | None): Whether to create a Disjoint SmartGraph
1243
- instead of a regular SmartGraph (Enterprise Edition only).
1244
- is_smart (bool | None): Define if the created graph should be smart
1245
- (Enterprise Edition only).
1243
+ instead of a regular SmartGraph. Only has an effect with
1244
+ `smart_graph_attribute` or `is_smart` (Enterprise Edition only).
1245
+ Deprecated: use `GraphOptions.is_disjoint` instead.
1246
+ is_smart (bool | None): If `True`, create a SmartGraph when
1247
+ `options.smart_graph_attribute` is set, or an EnterpriseGraph
1248
+ otherwise. Ignored for SatelliteGraphs (Enterprise Edition only).
1249
+ Deprecated: use `GraphOptions.is_smart` instead.
1246
1250
  options (GraphOptions | dict | None): Options for creating collections
1247
- within this graph.
1251
+ within this graph. Setting `smart_graph_attribute` creates a
1252
+ SmartGraph even if `is_smart` is omitted or `False`. Explicit
1253
+ `is_smart` and `is_disjoint` arguments override the corresponding
1254
+ entries in these options.
1248
1255
  orphan_collections (list | None): An array of additional vertex
1249
1256
  collections. Documents in these collections do not have edges
1250
1257
  within this graph.
@@ -1260,6 +1267,15 @@ class Database:
1260
1267
  References:
1261
1268
  - `create-a-graph <https://docs.arango.ai/arangodb/stable/develop/http-api/graphs/named-graphs/#create-a-graph>`__
1262
1269
  """ # noqa: E501
1270
+ if is_smart is not None or is_disjoint is not None:
1271
+ warn(
1272
+ "The separate is_smart and is_disjoint arguments are deprecated; "
1273
+ "pass these flags through GraphOptions or the options "
1274
+ "dictionary instead.",
1275
+ DeprecationWarning,
1276
+ stacklevel=2,
1277
+ )
1278
+
1263
1279
  params: Params = {}
1264
1280
  if wait_for_sync is not None:
1265
1281
  params["waitForSync"] = wait_for_sync
@@ -1267,15 +1283,15 @@ class Database:
1267
1283
  data: Json = {"name": name}
1268
1284
  if edge_definitions is not None:
1269
1285
  data["edgeDefinitions"] = edge_definitions
1270
- if is_disjoint is not None:
1271
- data["isDisjoint"] = is_disjoint
1272
- if is_smart is not None:
1273
- data["isSmart"] = is_smart
1274
1286
  if options is not None:
1275
1287
  if isinstance(options, GraphOptions):
1276
- data["options"] = options.to_dict()
1288
+ data["options"] = options.to_dict().copy()
1277
1289
  else:
1278
- data["options"] = options
1290
+ data["options"] = options.copy()
1291
+ if is_disjoint is not None:
1292
+ data.setdefault("options", {})["isDisjoint"] = is_disjoint
1293
+ if is_smart is not None:
1294
+ data.setdefault("options", {})["isSmart"] = is_smart
1279
1295
  if orphan_collections is not None:
1280
1296
  data["orphanCollections"] = orphan_collections
1281
1297
 
@@ -87,10 +87,11 @@ class Graph(Generic[T, U, V]):
87
87
  """Get the properties of the graph.
88
88
 
89
89
  Returns:
90
- GraphProperties: Properties of the graph.
90
+ GraphProperties: Properties of the graph, including `is_smart`,
91
+ `is_disjoint`, and `smart_graph_attribute`.
91
92
 
92
93
  Raises:
93
- GraphProperties: If the operation fails.
94
+ GraphPropertiesError: If the operation fails.
94
95
 
95
96
  References:
96
97
  - `get-a-graph <https://docs.arango.ai/arangodb/stable/develop/http-api/graphs/named-graphs/#get-a-graph>`__
@@ -1873,6 +1873,16 @@ class GraphProperties(JsonWrapper):
1873
1873
  """Check if the graph is a smart graph."""
1874
1874
  return cast(bool, self._data.get("isSmart", False))
1875
1875
 
1876
+ @property
1877
+ def is_disjoint(self) -> bool:
1878
+ """Check if the graph is a Disjoint SmartGraph."""
1879
+ return cast(bool, self._data.get("isDisjoint", False))
1880
+
1881
+ @property
1882
+ def smart_graph_attribute(self) -> Optional[str]:
1883
+ """Return the sharding attribute for a SmartGraph, if present."""
1884
+ return cast(Optional[str], self._data.get("smartGraphAttribute"))
1885
+
1876
1886
  @property
1877
1887
  def is_satellite(self) -> bool:
1878
1888
  """Check if the graph is a satellite graph."""
@@ -1963,6 +1973,10 @@ class GraphOptions(JsonWrapper):
1963
1973
  Enterprise Edition.
1964
1974
  write_concern (int | None): The write concern for new collections in the
1965
1975
  graph.
1976
+ is_smart (bool | None): Create a SmartGraph when `smart_graph_attribute`
1977
+ is set, or an EnterpriseGraph otherwise. Ignored for SatelliteGraphs.
1978
+ is_disjoint (bool | None): Create a Disjoint SmartGraph. Only has an
1979
+ effect with `smart_graph_attribute` or `is_smart`.
1966
1980
 
1967
1981
  References:
1968
1982
  - `create-a-graph <https://docs.arango.ai/arangodb/stable/develop/http-api/graphs/named-graphs/#create-a-graph>`__
@@ -1975,6 +1989,8 @@ class GraphOptions(JsonWrapper):
1975
1989
  satellites: Optional[List[str]] = None,
1976
1990
  smart_graph_attribute: Optional[str] = None,
1977
1991
  write_concern: Optional[int] = None,
1992
+ is_smart: Optional[bool] = None,
1993
+ is_disjoint: Optional[bool] = None,
1978
1994
  ) -> None:
1979
1995
  data: Json = dict()
1980
1996
  if number_of_shards is not None:
@@ -1987,8 +2003,20 @@ class GraphOptions(JsonWrapper):
1987
2003
  data["smartGraphAttribute"] = smart_graph_attribute
1988
2004
  if write_concern is not None:
1989
2005
  data["writeConcern"] = write_concern
2006
+ if is_smart is not None:
2007
+ data["isSmart"] = is_smart
2008
+ if is_disjoint is not None:
2009
+ data["isDisjoint"] = is_disjoint
1990
2010
  super().__init__(data)
1991
2011
 
2012
+ @property
2013
+ def is_smart(self) -> Optional[bool]:
2014
+ return cast(Optional[bool], self._data.get("isSmart"))
2015
+
2016
+ @property
2017
+ def is_disjoint(self) -> Optional[bool]:
2018
+ return cast(Optional[bool], self._data.get("isDisjoint"))
2019
+
1992
2020
  @property
1993
2021
  def number_of_shards(self) -> Optional[int]:
1994
2022
  return cast(int, self._data.get("numberOfShards"))
@@ -0,0 +1 @@
1
+ __version__ = "1.2.7"
@@ -42,6 +42,45 @@ For more information, refer to `ArangoDB Manual`_.
42
42
  # Delete the graph.
43
43
  await db.delete_graph("school")
44
44
 
45
+ Graph creation options
46
+ ======================
47
+
48
+ Pass ``GraphOptions(is_smart=True)`` as ``options`` to create an EnterpriseGraph
49
+ without a user-defined sharding attribute. Set ``GraphOptions.smart_graph_attribute``
50
+ to create a SmartGraph; ``is_smart=True`` is then optional. Every vertex must
51
+ contain the named attribute.
52
+
53
+ Set ``is_disjoint=True`` in ``GraphOptions`` with a smart graph attribute to create
54
+ a Disjoint SmartGraph, which rejects edges between vertices with different
55
+ attribute values.
56
+ For example, on an Enterprise cluster:
57
+
58
+ .. code-block:: python
59
+
60
+ from arangoasync.typings import GraphOptions
61
+
62
+ regional = await db.create_graph(
63
+ "regional",
64
+ edge_definitions=[{
65
+ "collection": "routes",
66
+ "from": ["places"],
67
+ "to": ["places"],
68
+ }],
69
+ options=GraphOptions(
70
+ number_of_shards=3,
71
+ smart_graph_attribute="region",
72
+ is_disjoint=True,
73
+ ),
74
+ )
75
+ properties = await regional.properties()
76
+ assert properties.is_disjoint is True
77
+ assert properties.smart_graph_attribute == "region"
78
+
79
+ The separate ``create_graph(is_smart=..., is_disjoint=...)`` arguments are
80
+ deprecated. Pass these flags through ``GraphOptions`` or a raw ``options``
81
+ dictionary instead. Existing separate arguments still take precedence over
82
+ matching entries in ``options``, including explicit ``False`` values.
83
+
45
84
  .. _edge-definitions:
46
85
 
47
86
  Edge Definitions
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.2.6
3
+ Version: 1.2.7
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>
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.2.7",
3
+ "distance": 0,
4
+ "node": "g12c7199ddcd06703b96d0eecce389697256c0c00",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-25"
8
+ }
@@ -52,8 +52,8 @@ async def test_simple_query(db, bad_db, doc_col, docs):
52
52
 
53
53
 
54
54
  @pytest.mark.asyncio
55
- async def test_query_tracking(db, bad_db):
56
- aql = db.aql
55
+ async def test_query_tracking(sys_db, bad_db):
56
+ aql = sys_db.aql
57
57
 
58
58
  # Get the current tracking properties.
59
59
  tracking = await aql.tracking()
@@ -1,7 +1,9 @@
1
1
  import pytest
2
2
 
3
+ from arangoasync.errno import INVALID_DISJOINT_SMART_EDGE
3
4
  from arangoasync.exceptions import (
4
5
  DocumentDeleteError,
6
+ DocumentInsertError,
5
7
  EdgeCollectionListError,
6
8
  EdgeDefinitionDeleteError,
7
9
  EdgeDefinitionListError,
@@ -19,6 +21,80 @@ from arangoasync.typings import GraphOptions
19
21
  from tests.helpers import generate_col_name, generate_graph_name
20
22
 
21
23
 
24
+ @pytest.mark.asyncio
25
+ @pytest.mark.parametrize("creation_api", ["options", "legacy"])
26
+ @pytest.mark.parametrize(
27
+ "smart_field,disjoint",
28
+ [(None, False), ("region", False), ("region", True)],
29
+ ids=["enterprise", "smart", "disjoint-smart"],
30
+ )
31
+ async def test_graph_create_smart_options(
32
+ db, cluster, skip_tests, smart_field, disjoint, creation_api
33
+ ):
34
+ if "enterprise" in skip_tests:
35
+ pytest.skip("Only for ArangoDB enterprise edition")
36
+ if not cluster:
37
+ pytest.skip("Only for ArangoDB clusters")
38
+
39
+ # Create an EnterpriseGraph, SmartGraph, or Disjoint SmartGraph.
40
+ graph_name = generate_graph_name()
41
+ vertices = generate_col_name()
42
+ edges = generate_col_name()
43
+ options = GraphOptions(
44
+ number_of_shards=3,
45
+ smart_graph_attribute=smart_field,
46
+ is_smart=True,
47
+ is_disjoint=disjoint,
48
+ )
49
+ kwargs = {}
50
+ if creation_api == "legacy":
51
+ options = GraphOptions(
52
+ number_of_shards=3,
53
+ smart_graph_attribute=smart_field,
54
+ is_smart=False,
55
+ is_disjoint=not disjoint,
56
+ )
57
+ kwargs = {"is_smart": True, "is_disjoint": disjoint}
58
+ original_options = options.to_dict().copy()
59
+ graph = await db.create_graph(
60
+ graph_name,
61
+ edge_definitions=[{"collection": edges, "from": [vertices], "to": [vertices]}],
62
+ options=options,
63
+ **kwargs,
64
+ )
65
+ try:
66
+ assert options.to_dict() == original_options
67
+ # Check that the server honored the graph creation options.
68
+ properties = await graph.properties()
69
+ assert properties.is_smart is True
70
+ assert properties.is_disjoint is disjoint
71
+ assert (properties.smart_graph_attribute or "") == (smart_field or "")
72
+ assert properties.number_of_shards == 3
73
+
74
+ # Add two vertices in one region and a third in another.
75
+ first = await graph.insert_vertex(vertices, {"region": "eu"})
76
+ second = await graph.insert_vertex(vertices, {"region": "eu"})
77
+ third = await graph.insert_vertex(vertices, {"region": "us"})
78
+ # All three graph types must allow edges within a region.
79
+ edge = await graph.insert_edge(
80
+ edges, {"_from": first["_id"], "_to": second["_id"]}
81
+ )
82
+ assert await graph.has_edge(edge["_id"])
83
+
84
+ # Only the disjoint graph must reject edges between regions.
85
+ cross_region_edge = {"_from": first["_id"], "_to": third["_id"]}
86
+ if disjoint:
87
+ with pytest.raises(DocumentInsertError) as err:
88
+ await graph.insert_edge(edges, cross_region_edge)
89
+ assert err.value.error_code == INVALID_DISJOINT_SMART_EDGE
90
+ else:
91
+ edge = await graph.insert_edge(edges, cross_region_edge)
92
+ assert await graph.has_edge(edge["_id"])
93
+ finally:
94
+ # Remove the graph and its collections even if an assertion fails.
95
+ await db.delete_graph(graph_name, drop_collections=True)
96
+
97
+
22
98
  @pytest.mark.asyncio
23
99
  async def test_graph_basic(db, bad_db):
24
100
  graph1_name = generate_graph_name()
@@ -60,8 +136,8 @@ async def test_graph_properties(db, bad_graph, cluster, skip_tests):
60
136
  # Create a graph
61
137
  name = generate_graph_name()
62
138
  is_smart = cluster and "enterprise" not in skip_tests
63
- options = GraphOptions(number_of_shards=3)
64
- graph = await db.create_graph(name, is_smart=is_smart, options=options)
139
+ options = GraphOptions(number_of_shards=3, is_smart=is_smart)
140
+ graph = await db.create_graph(name, options=options)
65
141
 
66
142
  with pytest.raises(GraphPropertiesError):
67
143
  await bad_graph.properties()
@@ -358,6 +358,17 @@ def test_GraphProperties():
358
358
  ]
359
359
  assert graph_properties.orphan_collections == ["orphan1", "orphan2"]
360
360
 
361
+ for is_disjoint in (False, True):
362
+ properties = GraphProperties(
363
+ {"isDisjoint": is_disjoint, "smartGraphAttribute": "region"}
364
+ )
365
+ assert properties.is_disjoint is is_disjoint
366
+ assert properties.smart_graph_attribute == "region"
367
+
368
+ properties = GraphProperties({})
369
+ assert properties.is_disjoint is False
370
+ assert properties.smart_graph_attribute is None
371
+
361
372
 
362
373
  def test_GraphOptions():
363
374
  graph_options = GraphOptions(
@@ -374,6 +385,18 @@ def test_GraphOptions():
374
385
  assert graph_options.smart_graph_attribute == "region"
375
386
  assert graph_options.write_concern == 1
376
387
 
388
+ for flag in (False, True):
389
+ options = GraphOptions(is_smart=flag, is_disjoint=flag)
390
+ assert options.is_smart is flag
391
+ assert options.is_disjoint is flag
392
+ assert options.to_dict() == {"isSmart": flag, "isDisjoint": flag}
393
+
394
+ options = GraphOptions()
395
+ assert options.is_smart is None
396
+ assert options.is_disjoint is None
397
+ assert "isSmart" not in options
398
+ assert "isDisjoint" not in options
399
+
377
400
 
378
401
  def test_VertexCollectionOptions():
379
402
  options = VertexCollectionOptions(
@@ -1 +0,0 @@
1
- __version__ = "1.2.6"
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "1.2.6",
3
- "distance": 0,
4
- "node": "gf4076da6dfc241bee1192e250dbb352edcc276ba",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-10-04"
8
- }