3131from azure .cosmos .partition_key import _get_partition_key_from_partition_key_definition
3232from azure .cosmos import CosmosList
3333if TYPE_CHECKING :
34- from azure .cosmos ._cosmos_client_connection import _PartitionKeyType , CosmosClientConnection
34+ from azure .cosmos ._cosmos_client_connection import PartitionKeyType , CosmosClientConnection
3535
3636
3737
@@ -43,7 +43,7 @@ def __init__(
4343 self ,
4444 client : 'CosmosClientConnection' ,
4545 collection_link : str ,
46- items : Sequence [Tuple [str , "_PartitionKeyType " ]],
46+ items : Sequence [Tuple [str , "PartitionKeyType " ]],
4747 options : Optional [Mapping [str , Any ]],
4848 partition_key_definition : Dict [str , Any ],
4949 * ,
@@ -87,7 +87,7 @@ def read_items(self) -> CosmosList:
8787 def _execute_with_executor (
8888 self ,
8989 executor : ThreadPoolExecutor ,
90- query_chunks : List [Dict [str , List [Tuple [int , str , "_PartitionKeyType " ]]]]
90+ query_chunks : List [Dict [str , List [Tuple [int , str , "PartitionKeyType " ]]]]
9191 ) -> CosmosList :
9292 """Execute the queries using the provided executor with improved error handling.
9393
@@ -141,7 +141,7 @@ def _execute_with_executor(
141141
142142 return cosmos_list
143143
144- def _partition_items_by_range (self ) -> Dict [str , List [Tuple [int , str , "_PartitionKeyType " ]]]:
144+ def _partition_items_by_range (self ) -> Dict [str , List [Tuple [int , str , "PartitionKeyType " ]]]:
145145 # pylint: disable=protected-access
146146 """Groups items by their partition key range ID efficiently while preserving original order.
147147
@@ -150,10 +150,10 @@ def _partition_items_by_range(self) -> Dict[str, List[Tuple[int, str, "_Partitio
150150 """
151151 collection_rid = _base .GetResourceIdOrFullNameFromLink (self .collection_link )
152152 partition_key = _get_partition_key_from_partition_key_definition (self .partition_key_definition )
153- items_by_partition : Dict [str , List [Tuple [int , str , "_PartitionKeyType " ]]] = {}
153+ items_by_partition : Dict [str , List [Tuple [int , str , "PartitionKeyType " ]]] = {}
154154
155155 # Group items by logical partition key first to avoid redundant range lookups
156- items_by_pk_value : Dict [Any , List [Tuple [int , str , "_PartitionKeyType " ]]] = {}
156+ items_by_pk_value : Dict [Any , List [Tuple [int , str , "PartitionKeyType " ]]] = {}
157157 for idx , (item_id , pk_value ) in enumerate (self .items ):
158158 # Convert list to tuple to use as a dictionary key, as lists are unhashable
159159 key = tuple (pk_value ) if isinstance (pk_value , list ) else pk_value
@@ -180,8 +180,8 @@ def _partition_items_by_range(self) -> Dict[str, List[Tuple[int, str, "_Partitio
180180
181181 def _create_query_chunks (
182182 self ,
183- items_by_partition : Dict [str , List [Tuple [int , str , "_PartitionKeyType " ]]]
184- ) -> List [Dict [str , List [Tuple [int , str , "_PartitionKeyType " ]]]]:
183+ items_by_partition : Dict [str , List [Tuple [int , str , "PartitionKeyType " ]]]
184+ ) -> List [Dict [str , List [Tuple [int , str , "PartitionKeyType " ]]]]:
185185 """Create query chunks for concurrency control while preserving original indices.
186186
187187 :param items_by_partition: A dictionary mapping partition key range IDs to lists of items with indices.
@@ -198,7 +198,7 @@ def _create_query_chunks(
198198 return query_chunks
199199
200200 def _execute_query_chunk_worker (
201- self , partition_id : str , chunk_partition_items : Sequence [Tuple [int , str , "_PartitionKeyType " ]]
201+ self , partition_id : str , chunk_partition_items : Sequence [Tuple [int , str , "PartitionKeyType " ]]
202202 ) -> Tuple [List [Tuple [int , Dict [str , Any ]]], float ]:
203203 """Synchronous worker to build and execute a query for a chunk of items.
204204
@@ -231,7 +231,7 @@ def _execute_query_chunk_worker(
231231 def _execute_query (
232232 self ,
233233 partition_id : str ,
234- items_for_query : Sequence [Tuple [str , "_PartitionKeyType " ]],
234+ items_for_query : Sequence [Tuple [str , "PartitionKeyType " ]],
235235 id_to_idx : Dict [str , int ],
236236 request_kwargs : Dict [str , Any ]
237237 ) -> Tuple [List [Tuple [int , Any ]], CaseInsensitiveDict ]:
@@ -281,7 +281,7 @@ def local_response_hook(hook_headers, _):
281281 def _execute_point_read (
282282 self ,
283283 item_id : str ,
284- pk_value : "_PartitionKeyType " ,
284+ pk_value : "PartitionKeyType " ,
285285 request_kwargs : Dict [str , Any ]
286286 ) -> Tuple [Optional [Any ], CaseInsensitiveDict ]:
287287 """
0 commit comments