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(
720720 :return: Document cursor.
721721 :rtype: arango.cursor.Cursor
722722 :raise arango.exceptions.DocumentGetError: If retrieval fails.
723+ :raise arango.exceptions.SortValidationError: If sort parameters are invalid.
723724 """
724725 assert is_none_or_int (skip ), "skip must be a non-negative int"
725726 assert is_none_or_int (limit ), "limit must be a non-negative int"
@@ -755,7 +756,7 @@ def find(
755756 skip : Optional [int ] = None ,
756757 limit : Optional [int ] = None ,
757758 allow_dirty_read : bool = False ,
758- sort : Sequence [ Json ] = [],
759+ sort : Jsons = [],
759760 ) -> Result [Cursor ]:
760761 """Return all documents that match the given filters.
761762
@@ -767,6 +768,8 @@ def find(
767768 :type limit: int | None
768769 :param allow_dirty_read: Allow reads from followers in a cluster.
769770 :type allow_dirty_read: bool
771+ :param sort: Document sort parameters
772+ :type sort: Jsons
770773 :return: Document cursor.
771774 :rtype: arango.cursor.Cursor
772775 :raise arango.exceptions.DocumentGetError: If retrieval fails.
Original file line number Diff line number Diff line change @@ -1074,3 +1074,10 @@ class JWTRefreshError(ArangoClientError):
10741074
10751075class JWTExpiredError (ArangoClientError ):
10761076 """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 1212from typing import Any , Iterator , Sequence , Union
1313
1414from arango .exceptions import DocumentParseError
15- from arango .typings import Json
15+ from arango .typings import Json , Jsons
1616
1717
1818@contextmanager
@@ -148,11 +148,11 @@ def validate_sort_parameters(sort: Sequence[Json]) -> bool:
148148 return True
149149
150150
151- def build_sort_expression (sort : Sequence [ Json ] ) -> str :
151+ def build_sort_expression (sort : Jsons ) -> str :
152152 """Build a sort condition for an AQL query.
153153
154154 :param sort: Document sort parameters.
155- :type sort: Sequence[Json]
155+ :type sort: Jsons
156156 :return: The complete AQL sort condition.
157157 :rtype: str
158158 """
You can’t perform that action at this time.
0 commit comments