99
1010import sqlalchemy as sa
1111from bson import SON
12- from pymongo import CursorType , helpers
12+ from pymongo import CursorType , helpers_shared
1313from pymongo .client_session import ClientSession
1414from pymongo .collation import validate_collation_or_none
1515from pymongo .collection import Collection
1616from pymongo .common import validate_is_document_type , validate_is_mapping
17- from pymongo .cursor import _QUERY_OPTIONS , Cursor , _Hint , _Sort
17+ from pymongo .cursor import Cursor
18+ from pymongo .cursor_shared import _QUERY_OPTIONS , _Hint , _Sort
1819from pymongo .errors import InvalidOperation
1920from pymongo .message import _GetMore , _Query
2021from pymongo .read_preferences import _ServerMode
@@ -119,7 +120,7 @@ def __init__(
119120 allow_disk_use = validate_boolean ("allow_disk_use" , allow_disk_use )
120121
121122 if projection is not None :
122- projection = helpers ._fields_list_to_dict (projection , "projection" )
123+ projection = helpers_shared ._fields_list_to_dict (projection , "projection" )
123124
124125 if let is not None :
125126 validate_is_document_type ("let" , let )
@@ -131,7 +132,7 @@ def __init__(
131132 self .__skip = skip
132133 self .__limit = limit
133134 self .__batch_size = batch_size
134- self .__ordering = sort and helpers ._index_document (sort ) or None
135+ self .__ordering = sort and helpers_shared ._index_document (sort ) or None
135136 self .__max_scan = max_scan
136137 self .__explain = False
137138 self .__comment = comment
@@ -287,8 +288,8 @@ def _refresh(self) -> int:
287288
288289 def sort (self , key_or_list : _Hint , direction : Optional [Union [int , str ]] = None ) -> Cursor [_DocumentType ]:
289290 """ """
290- keys = helpers ._index_list (key_or_list , direction )
291- self .__ordering = helpers ._index_document (keys )
291+ keys = helpers_shared ._index_list (key_or_list , direction )
292+ self .__ordering = helpers_shared ._index_document (keys )
292293 return self
293294
294295 def __send_message (self , operation : Union [_Query , _GetMore ]) -> None :
@@ -385,6 +386,6 @@ def __set_hint(self, index: Optional[_Hint]) -> None:
385386 if isinstance (index , str ):
386387 self .__hint = index
387388 else :
388- self .__hint = SON (helpers ._index_document (index ))
389+ self .__hint = SON (helpers_shared ._index_document (index ))
389390
390391 return AmendedCursor
0 commit comments