Skip to content

Commit

Permalink
Merge pull request #1348 from keboola/vb-fix-client
Browse files Browse the repository at this point in the history
FIX client method for refresh-tables-information in bucket
  • Loading branch information
vojtabiberle authored Jun 6, 2024
2 parents a331eca + f79aa43 commit 2a232b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Keboola/StorageApi/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,9 @@ public function refreshBucket(string $bucketId)
* error?: array{code: string|null, message: string|null, exceptionId: string|null}
* }
*/
public function refreshTableInformationInBucket(int $branchId, string $bucketId)
public function refreshTableInformationInBucket(string $bucketId)
{
$url = sprintf('branch/%s/buckets/%s/refresh-tables-info', $branchId, $bucketId);
$url = sprintf('buckets/%s/refresh-tables-info', $bucketId);

return $this->apiPostJson($url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

use Keboola\StorageApi\Workspaces;
use Keboola\TableBackendUtils\Escaping\Snowflake\SnowflakeQuote;
use Keboola\Test\Backend\Workspaces\Backend\WorkspaceBackendFactory;
use Keboola\Test\Utils\ConnectionUtils;
use Throwable;

class SnowflakeBucketsRefreshTablesInformationTest extends BaseExternalBuckets
{
Expand All @@ -19,7 +17,8 @@ public function testRefreshTablesInformationEndpointExists(): void
$bucketId = $this->initEmptyBucketWithDescription(self::STAGE_IN);
$bucket = $this->_client->getBucket($bucketId);

$this->_client->refreshTableInformationInBucket($bucket['idBranch'], $bucketId);
$bClient = $this->getBranchAwareDefaultClient($bucket['idBranch']);
$bClient->refreshTableInformationInBucket($bucketId);
$this->assertTrue(true, 'Testing only if requests working.');

$this->dropBucketIfExists($this->_client, $bucketId);
Expand Down Expand Up @@ -73,9 +72,11 @@ public function testRefreshTablesInformation(): void
),
);

$jobInfo = $this->_client->refreshTableInformationInBucket($bucket['idBranch'], $bucketId);
$bClient = $this->getBranchAwareDefaultClient($bucket['idBranch']);

$this->_client->waitForJob($jobInfo['id']);
$jobInfo = $bClient->refreshTableInformationInBucket($bucketId);

$bClient->waitForJob($jobInfo['id']);

$refreshedTable = $this->_client->getTable($tableId);

Expand Down

0 comments on commit 2a232b5

Please sign in to comment.