python-arango-async 1.2.5__py3-none-any.whl → 1.2.7__py3-none-any.whl

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.
arangoasync/database.py CHANGED
@@ -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
 
arangoasync/graph.py CHANGED
@@ -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>`__
arangoasync/typings.py CHANGED
@@ -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"))
arangoasync/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.5"
1
+ __version__ = "1.2.7"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.2.5
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>
@@ -8,12 +8,12 @@ arangoasync/collection.py,sha256=BXpFmCxqzB4qkCMMIJth4abq3ehHh62MEYovIzicFCY,124
8
8
  arangoasync/compression.py,sha256=vMhcg5nQPkbgplk48vxARUnJ6YeIwrCLC6pDCVJSwo0,3804
9
9
  arangoasync/connection.py,sha256=f6HQOZHayluNVyH-j-sujlE_dvQrVxC1lPWnzrfQLqY,17459
10
10
  arangoasync/cursor.py,sha256=RQJOtNpxEx5n3eKx7UYPl1N8gzWYQESjufvakr18azk,8464
11
- arangoasync/database.py,sha256=tjdxJBJ5q6X8Q5qIVTLKPb6-tEPnNKV9EUIa-k1_K9Q,139492
11
+ arangoasync/database.py,sha256=8GfFG9ZhfjsThoXeNCZkIBbf-LrlkSOx-hgLjw-eTA8,140476
12
12
  arangoasync/errno.py,sha256=4oKY9IyyzjOitbywhjH8S214qeNtpDlQg7JsHENJNoU,25245
13
13
  arangoasync/exceptions.py,sha256=lyb5iWMj71nNli32t23AWXKyOldQEJRuKoChtf0uBss,20000
14
14
  arangoasync/executor.py,sha256=eRUfWQc4eHgJr15nPnDju8oSK0408x6yB8XEGk7YhPY,4740
15
15
  arangoasync/foxx.py,sha256=qksGB7Y65_J4f6uThQzBHvmIOzjomslV4pIqohtBS54,28924
16
- arangoasync/graph.py,sha256=G-todTf-ldTQtS2uhCsiigdPL4WABbbfTrLKlIPFkhA,40953
16
+ arangoasync/graph.py,sha256=gl5DTOb4wi8XFq3_3_sm1sQ23EDo8_-n-_icOgGJhpM,41040
17
17
  arangoasync/http.py,sha256=xkxnLMbqFBEngmqGCuBOgRuXgQSBUk9-dzYXB1yrL98,6154
18
18
  arangoasync/job.py,sha256=B9cPDzxaYflWDj95j941wrcCj4w5j-gnmSzs3TdNdfw,7471
19
19
  arangoasync/logger.py,sha256=Ui4n-ELcYM4fujpZV6myU4by82L_70S1cfG0bhEhf-Q,58
@@ -23,10 +23,10 @@ arangoasync/resolver.py,sha256=icsmQIkklrvq-a88vIR8C-M3rcv5BJxhDE2PK8LenG0,3409
23
23
  arangoasync/response.py,sha256=VMnoWgtyrh1JGK7mEgRNsUtSawxWMgFjHT-Cff4d8zc,2132
24
24
  arangoasync/result.py,sha256=NVwFxpYUDujHNRCqCZIBOlGLzB7XsiSmjWPFhUgRS6k,233
25
25
  arangoasync/serialization.py,sha256=ExRqrEpbk11Hb3AfFUJGqPlGBD3dbvwQg_xsZUsrm6I,2910
26
- arangoasync/typings.py,sha256=LmKV4_jNUoxZ6cI91l8H2XimhYl945ow_3FrcVEoB50,70480
27
- arangoasync/version.py,sha256=jBmZf3HLbiQlWiolOsAA6J5-BbxXD2bqFqEqDH3lfqo,22
28
- python_arango_async-1.2.5.dist-info/licenses/LICENSE,sha256=6zoGhJon2tcnvzmycirNjLNBZ6rlLJtYDdVGO76RXVM,1065
29
- python_arango_async-1.2.5.dist-info/METADATA,sha256=8dPPxISrFp18gU9zhZsuvdpW-OQreOptVKoJlrFZ62Y,7943
30
- python_arango_async-1.2.5.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
31
- python_arango_async-1.2.5.dist-info/top_level.txt,sha256=uabwJ6t-MiIaZQXGUvYikeSbZDcF0RK37GzikBnDz5k,12
32
- python_arango_async-1.2.5.dist-info/RECORD,,
26
+ arangoasync/typings.py,sha256=Pk738JV370ryqcD72_v1TGVAPePIsfyuWk3ZSQtE5hc,71656
27
+ arangoasync/version.py,sha256=49prCLbE3fFzLfxem5rd2dr1iV4_L-bN0N4J7jxU5yA,22
28
+ python_arango_async-1.2.7.dist-info/licenses/LICENSE,sha256=6zoGhJon2tcnvzmycirNjLNBZ6rlLJtYDdVGO76RXVM,1065
29
+ python_arango_async-1.2.7.dist-info/METADATA,sha256=wBkgegGo-SygnFkimTksoDegD1v5HrHI9LErRYipL9s,7943
30
+ python_arango_async-1.2.7.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
31
+ python_arango_async-1.2.7.dist-info/top_level.txt,sha256=uabwJ6t-MiIaZQXGUvYikeSbZDcF0RK37GzikBnDz5k,12
32
+ python_arango_async-1.2.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (84.0.0)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5