Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yash30201 committed May 7, 2024
1 parent d45178c commit b9f0661
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Datastore/src/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b9f0661

Please sign in to comment.