Skip to content

Commit

Permalink
add retry on BQ isTableExists
Browse files Browse the repository at this point in the history
  • Loading branch information
zajca committed Dec 11, 2024
1 parent edb2966 commit 346c84e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Keboola\TableBackendUtils\Table\Bigquery\BigqueryTableReflection;
use Keboola\TableBackendUtils\View\ViewReflectionInterface;
use PDO;
use Retry\RetryProxy;

class BigqueryWorkspaceBackend implements WorkspaceBackend
{
Expand Down Expand Up @@ -218,7 +219,9 @@ protected function isTableExists(string $schema, string $table): bool
$dataset = $this->bqClient->dataset($schema);
$table = $dataset->table($table);

return $table->exists();
return (new RetryProxy())->call(function () use ($table) {

Check failure on line 222 in tests/Backend/Workspaces/Backend/BigqueryWorkspaceBackend.php

View workflow job for this annotation

GitHub Actions / tests (8.1)

Method Keboola\Test\Backend\Workspaces\Backend\BigqueryWorkspaceBackend::isTableExists() should return bool but returns mixed.

Check failure on line 222 in tests/Backend/Workspaces/Backend/BigqueryWorkspaceBackend.php

View workflow job for this annotation

GitHub Actions / tests (8.2)

Method Keboola\Test\Backend\Workspaces\Backend\BigqueryWorkspaceBackend::isTableExists() should return bool but returns mixed.

Check failure on line 222 in tests/Backend/Workspaces/Backend/BigqueryWorkspaceBackend.php

View workflow job for this annotation

GitHub Actions / tests (8.3)

Method Keboola\Test\Backend\Workspaces\Backend\BigqueryWorkspaceBackend::isTableExists() should return bool but returns mixed.
return $table->exists();
});
}

public function dropViewIfExists(string $table): void
Expand Down

0 comments on commit 346c84e

Please sign in to comment.