1111
1212import sqlalchemy as sa
1313from bson import SON
14- from pymongo import CursorType , helpers
14+ from pymongo import CursorType , helpers_shared
1515from pymongo .client_session import ClientSession
1616from pymongo .collation import validate_collation_or_none
1717from pymongo .collection import Collection
1818from pymongo .common import validate_is_document_type , validate_is_mapping
19- from pymongo .cursor import _QUERY_OPTIONS , Cursor , _Hint , _Sort
19+ from pymongo .cursor import Cursor
20+ from pymongo .cursor_shared import _QUERY_OPTIONS , _Hint , _Sort
2021from pymongo .errors import InvalidOperation
2122from pymongo .message import _GetMore , _Query
2223from pymongo .read_preferences import _ServerMode
@@ -121,7 +122,7 @@ def __init__(
121122 allow_disk_use = validate_boolean ("allow_disk_use" , allow_disk_use )
122123
123124 if projection is not None :
124- projection = helpers ._fields_list_to_dict (projection , "projection" )
125+ projection = helpers_shared ._fields_list_to_dict (projection , "projection" )
125126
126127 if let is not None :
127128 validate_is_document_type ("let" , let )
@@ -133,7 +134,7 @@ def __init__(
133134 self .__skip = skip
134135 self .__limit = limit
135136 self .__batch_size = batch_size
136- self .__ordering = sort and helpers ._index_document (sort ) or None
137+ self .__ordering = sort and helpers_shared ._index_document (sort ) or None
137138 self .__max_scan = max_scan
138139 self .__explain = False
139140 self .__comment = comment
@@ -289,8 +290,8 @@ def _refresh(self) -> int:
289290
290291 def sort (self , key_or_list : _Hint , direction : Optional [Union [int , str ]] = None ) -> Cursor [_DocumentType ]:
291292 """ """
292- keys = helpers ._index_list (key_or_list , direction )
293- self .__ordering = helpers ._index_document (keys )
293+ keys = helpers_shared ._index_list (key_or_list , direction )
294+ self .__ordering = helpers_shared ._index_document (keys )
294295 return self
295296
296297 def __send_message (self , operation : Union [_Query , _GetMore ]) -> None :
@@ -387,6 +388,6 @@ def __set_hint(self, index: Optional[_Hint]) -> None:
387388 if isinstance (index , str ):
388389 self .__hint = index
389390 else :
390- self .__hint = SON (helpers ._index_document (index ))
391+ self .__hint = SON (helpers_shared ._index_document (index ))
391392
392393 return AmendedCursor
0 commit comments