File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -720,6 +720,7 @@ def all(
720
720
:return: Document cursor.
721
721
:rtype: arango.cursor.Cursor
722
722
:raise arango.exceptions.DocumentGetError: If retrieval fails.
723
+ :raise arango.exceptions.SortValidationError: If sort parameters are invalid.
723
724
"""
724
725
assert is_none_or_int (skip ), "skip must be a non-negative int"
725
726
assert is_none_or_int (limit ), "limit must be a non-negative int"
@@ -755,7 +756,7 @@ def find(
755
756
skip : Optional [int ] = None ,
756
757
limit : Optional [int ] = None ,
757
758
allow_dirty_read : bool = False ,
758
- sort : Sequence [ Json ] = [],
759
+ sort : Jsons = [],
759
760
) -> Result [Cursor ]:
760
761
"""Return all documents that match the given filters.
761
762
@@ -767,6 +768,8 @@ def find(
767
768
:type limit: int | None
768
769
:param allow_dirty_read: Allow reads from followers in a cluster.
769
770
:type allow_dirty_read: bool
771
+ :param sort: Document sort parameters
772
+ :type sort: Jsons
770
773
:return: Document cursor.
771
774
:rtype: arango.cursor.Cursor
772
775
:raise arango.exceptions.DocumentGetError: If retrieval fails.
Original file line number Diff line number Diff line change @@ -1074,3 +1074,10 @@ class JWTRefreshError(ArangoClientError):
1074
1074
1075
1075
class JWTExpiredError (ArangoClientError ):
1076
1076
"""JWT token has expired."""
1077
+
1078
+
1079
+ ###################################
1080
+ # Parameter Validation Exceptions #
1081
+ ###################################
1082
+ class SortValidationError (ArangoClientError ):
1083
+ """Invalid sort parameters."""
Original file line number Diff line number Diff line change 12
12
from typing import Any , Iterator , Sequence , Union
13
13
14
14
from arango .exceptions import DocumentParseError
15
- from arango .typings import Json
15
+ from arango .typings import Json , Jsons
16
16
17
17
18
18
@contextmanager
@@ -148,11 +148,11 @@ def validate_sort_parameters(sort: Sequence[Json]) -> bool:
148
148
return True
149
149
150
150
151
- def build_sort_expression (sort : Sequence [ Json ] ) -> str :
151
+ def build_sort_expression (sort : Jsons ) -> str :
152
152
"""Build a sort condition for an AQL query.
153
153
154
154
:param sort: Document sort parameters.
155
- :type sort: Sequence[Json]
155
+ :type sort: Jsons
156
156
:return: The complete AQL sort condition.
157
157
:rtype: str
158
158
"""
You can’t perform that action at this time.
0 commit comments