@@ -505,15 +505,15 @@ def query_items(
505505 max_integrated_cache_staleness_in_ms : Optional [int ] = None ,
506506 max_item_count : Optional [int ] = None ,
507507 parameters : Optional [List [Dict [str , object ]]] = None ,
508- partition_key : Optional [ PartitionKeyType ] = None ,
508+ partition_key : PartitionKeyType ,
509509 populate_index_metrics : Optional [bool ] = None ,
510510 populate_query_metrics : Optional [bool ] = None ,
511511 priority : Optional [Literal ["High" , "Low" ]] = None ,
512512 response_hook : Optional [Callable [[Mapping [str , str ], Dict [str , Any ]], None ]] = None ,
513513 session_token : Optional [str ] = None ,
514514 throughput_bucket : Optional [int ] = None ,
515515 ** kwargs : Any
516- ):
516+ ) -> AsyncItemPaged [ Dict [ str , Any ]] :
517517 """Return all results matching the given `query`.
518518
519519 You can use any value for the container name in the FROM clause, but
@@ -557,7 +557,7 @@ def query_items(
557557 :keyword str session_token: Token for use with Session consistency.
558558 :keyword int throughput_bucket: The desired throughput bucket for the client.
559559 :returns: An Iterable of items (dicts).
560- :rtype: ItemPaged [Dict[str, Any]]
560+ :rtype: AsyncItemPaged [Dict[str, Any]]
561561
562562 .. admonition:: Example:
563563
@@ -584,7 +584,7 @@ def query_items(
584584 * ,
585585 continuation_token_limit : Optional [int ] = None ,
586586 enable_scan_in_query : Optional [bool ] = None ,
587- feed_range : Optional [ Dict [str , Any ]] = None ,
587+ feed_range : Dict [str , Any ],
588588 initial_headers : Optional [Dict [str , str ]] = None ,
589589 max_integrated_cache_staleness_in_ms : Optional [int ] = None ,
590590 max_item_count : Optional [int ] = None ,
@@ -596,7 +596,7 @@ def query_items(
596596 session_token : Optional [str ] = None ,
597597 throughput_bucket : Optional [int ] = None ,
598598 ** kwargs : Any
599- ):
599+ ) -> AsyncItemPaged [ Dict [ str , Any ]] :
600600 """Return all results matching the given `query`.
601601
602602 You can use any value for the container name in the FROM clause, but
@@ -614,6 +614,7 @@ def query_items(
614614 in this list are specified as the names of the Azure Cosmos locations like, 'West US', 'East US' and so on.
615615 If all preferred locations were excluded, primary/hub location will be used.
616616 This excluded_location will override existing excluded_locations in client level.
617+ :keyword Dict[str, Any] feed_range: The feed range that is used to define the scope.
617618 :keyword Dict[str, str] initial_headers: Initial headers to be sent as part of the request.
618619 :keyword int max_integrated_cache_staleness_in_ms: The max cache staleness for the integrated cache in
619620 milliseconds. For accounts configured to use the integrated cache, using Session or Eventual consistency,
@@ -635,7 +636,84 @@ def query_items(
635636 :keyword str session_token: Token for use with Session consistency.
636637 :keyword int throughput_bucket: The desired throughput bucket for the client.
637638 :returns: An Iterable of items (dicts).
638- :rtype: ItemPaged[Dict[str, Any]]
639+ :rtype: AsyncItemPaged[Dict[str, Any]]
640+
641+ .. admonition:: Example:
642+
643+ .. literalinclude:: ../samples/examples_async.py
644+ :start-after: [START query_items]
645+ :end-before: [END query_items]
646+ :language: python
647+ :dedent: 0
648+ :caption: Get all products that have not been discontinued:
649+
650+ .. literalinclude:: ../samples/examples_async.py
651+ :start-after: [START query_items_param]
652+ :end-before: [END query_items_param]
653+ :language: python
654+ :dedent: 0
655+ :caption: Parameterized query to get all products that have been discontinued:
656+ """
657+ ...
658+
659+ @overload
660+ def query_items (
661+ self ,
662+ query : str ,
663+ * ,
664+ continuation_token_limit : Optional [int ] = None ,
665+ enable_scan_in_query : Optional [bool ] = None ,
666+ initial_headers : Optional [Dict [str , str ]] = None ,
667+ max_integrated_cache_staleness_in_ms : Optional [int ] = None ,
668+ max_item_count : Optional [int ] = None ,
669+ parameters : Optional [List [Dict [str , object ]]] = None ,
670+ populate_index_metrics : Optional [bool ] = None ,
671+ populate_query_metrics : Optional [bool ] = None ,
672+ priority : Optional [Literal ["High" , "Low" ]] = None ,
673+ response_hook : Optional [Callable [[Mapping [str , str ], Dict [str , Any ]], None ]] = None ,
674+ session_token : Optional [str ] = None ,
675+ throughput_bucket : Optional [int ] = None ,
676+ ** kwargs : Any
677+ ) -> AsyncItemPaged [Dict [str , Any ]]:
678+ """Return all results matching the given `query`.
679+
680+ You can use any value for the container name in the FROM clause, but
681+ often the container name is used. In the examples below, the container
682+ name is "products," and is aliased as "p" for easier referencing in
683+ the WHERE clause.
684+
685+ :param str query: The Azure Cosmos DB SQL query to execute.
686+ :keyword int continuation_token_limit: The size limit in kb of the response continuation token in the query
687+ response. Valid values are positive integers.
688+ A value of 0 is the same as not passing a value (default no limit).
689+ :keyword bool enable_scan_in_query: Allow scan on the queries which couldn't be served as
690+ indexing was opted out on the requested paths.
691+ :keyword list[str] excluded_locations: Excluded locations to be skipped from preferred locations. The locations
692+ in this list are specified as the names of the Azure Cosmos locations like, 'West US', 'East US' and so on.
693+ If all preferred locations were excluded, primary/hub location will be used.
694+ This excluded_location will override existing excluded_locations in client level.
695+ :keyword Dict[str, str] initial_headers: Initial headers to be sent as part of the request.
696+ :keyword int max_integrated_cache_staleness_in_ms: The max cache staleness for the integrated cache in
697+ milliseconds. For accounts configured to use the integrated cache, using Session or Eventual consistency,
698+ responses are guaranteed to be no staler than this value.
699+ :keyword int max_item_count: Max number of items to be returned in the enumeration operation.
700+ :keyword parameters: Optional array of parameters to the query.
701+ Each parameter is a dict() with 'name' and 'value' keys.
702+ Ignored if no query is provided.
703+ :paramtype parameters: [List[Dict[str, object]]]
704+ :keyword bool populate_index_metrics: Used to obtain the index metrics to understand how the query engine used
705+ existing indexes and how it could use potential new indexes. Please note that this option will incur
706+ overhead, so it should be enabled only when debugging slow queries.
707+ :keyword bool populate_query_metrics: Enable returning query metrics in response headers.
708+ :keyword Literal["High", "Low"] priority: Priority based execution allows users to set a priority for each
709+ request. Once the user has reached their provisioned throughput, low priority requests are throttled
710+ before high priority requests start getting throttled. Feature must first be enabled at the account level.
711+ :keyword response_hook: A callable invoked with the response metadata.
712+ :paramtype response_hook: Callable[[Mapping[str, str], Dict[str, Any]], None]
713+ :keyword str session_token: Token for use with Session consistency.
714+ :keyword int throughput_bucket: The desired throughput bucket for the client.
715+ :returns: An Iterable of items (dicts).
716+ :rtype: AsyncItemPaged[Dict[str, Any]]
639717
640718 .. admonition:: Example:
641719
@@ -708,7 +786,7 @@ def query_items(
708786 :keyword str session_token: Token for use with Session consistency.
709787 :keyword int throughput_bucket: The desired throughput bucket for the client.
710788 :returns: An Iterable of items (dicts).
711- :rtype: ItemPaged [Dict[str, Any]]
789+ :rtype: AsyncItemPaged [Dict[str, Any]]
712790
713791 .. admonition:: Example:
714792
0 commit comments