From b9f0661ca8ca663b3c4720855fb59644357a180d Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Tue, 7 May 2024 08:59:49 +0000 Subject: [PATCH] Add comments --- Datastore/src/Operation.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Datastore/src/Operation.php b/Datastore/src/Operation.php index a5a1feb82923..8eba08fc5341 100644 --- a/Datastore/src/Operation.php +++ b/Datastore/src/Operation.php @@ -462,6 +462,7 @@ public function lookup(array $keys, array $options = []) 'keys' => $this->keysList($serviceKeys), ]; + // Remove redundant keys for request. $this->pluckArray( ['transaction', 'className', 'sort', 'readTime', 'readConsistency'], $data @@ -587,6 +588,7 @@ public function runQuery(QueryInterface $query, array $options = []) list($data, $optionalArgs) = $this->splitOptionalArgs($req); + // Remove redundant keys for request. $this->pluckArray( ['className', 'namespaceId', 'readTime', 'readConsistency', 'transaction'], $data @@ -679,13 +681,14 @@ public function runAggregationQuery(AggregationQuery $runQueryObj, array $option ), ] + $requestQueryArr + $this->readOptions($options) + $options; + list($data, $optionalArgs) = $this->splitOptionalArgs($req); + + // Remove redundant keys for request. $this->pluckArray( ['namespaceId', 'readTime', 'readConsistency', 'transaction'], - $req + $data ); - list($data, $optionalArgs) = $this->splitOptionalArgs($req); - if (isset($data['aggregationQuery'])) { if (isset($data['aggregationQuery']['nestedQuery'])) { $data['aggregationQuery']['nestedQuery'] = $this->parseQuery( @@ -765,7 +768,10 @@ public function commit(array $mutations, array $options = []) unset($options['transaction']); } list($data, $optionalArgs) = $this->splitOptionalArgs($options); + + // Remove redundant keys for request. $this->pluckArray(['allowOverwrite', 'baseVersion'], $data); + $request = $this->serializer->decodeMessage(new CommitRequest(), $data); $res = $this->requestHandler->sendRequest( DatastoreClient::class,