@@ -180,42 +180,23 @@ def lookup(self, project_id, keys, read_options=None):
180180 _datastore_pb2 .LookupResponse ,
181181 )
182182
183- def run_query (
184- self , project_id , partition_id , read_options = None , query = None , gql_query = None
185- ):
183+ def run_query (self , request ):
186184 """Perform a ``runQuery`` request.
187185
188- :type project_id: str
189- :param project_id: The project to connect to. This is
190- usually your project name in the cloud console.
191-
192- :type partition_id: :class:`.entity_pb2.PartitionId`
193- :param partition_id: Partition ID corresponding to an optional
194- namespace and project ID.
195-
196- :type read_options: :class:`.datastore_pb2.ReadOptions`
197- :param read_options: (Optional) The options for this query. Contains
198- either the transaction for the read or
199- ``STRONG`` or ``EVENTUAL`` read consistency.
200-
201- :type query: :class:`.query_pb2.Query`
202- :param query: (Optional) The query protobuf to run. At most one of
203- ``query`` and ``gql_query`` can be specified.
204-
205- :type gql_query: :class:`.query_pb2.GqlQuery`
206- :param gql_query: (Optional) The GQL query to run. At most one of
207- ``query`` and ``gql_query`` can be specified.
186+ :type request: :class:`_datastore_pb2.BeginTransactionRequest` or dict
187+ :param request:
188+ Parameter bundle for API request.
208189
209190 :rtype: :class:`.datastore_pb2.RunQueryResponse`
210191 :returns: The returned protobuf response object.
211192 """
212- request_pb = _datastore_pb2 .RunQueryRequest (
213- project_id = project_id ,
214- partition_id = partition_id ,
215- read_options = read_options ,
216- query = query ,
217- gql_query = gql_query ,
218- )
193+ if not isinstance ( request , _datastore_pb2 .RunQueryRequest ):
194+ request_pb = _datastore_pb2 . RunQueryRequest ( ** request )
195+ else :
196+ request_pb = request
197+
198+ project_id = request_pb . project_id
199+
219200 return _rpc (
220201 self .client ._http ,
221202 project_id ,
0 commit comments