Skip to content

Commit

Permalink
Review with Devin contd.
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotrashivam committed Sep 20, 2024
1 parent 474700d commit 86b8031
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public void readSampleParquetFromPublicGCS() {

final Table tableWithNoRegionAndCredentials;
{
// Note that this assumes that credentials are not present in the credentials file. If they are, this test
// will fail.
final ParquetInstructions readInstructions = new ParquetInstructions.Builder()
.setSpecialInstructions(S3Instructions.builder()
.readTimeout(Duration.ofSeconds(60))
Expand Down Expand Up @@ -217,7 +219,7 @@ public void readKeyValuePartitionedParquetFromPublicS3() {
}

/**
* The follow test reads from Deephaven's s3 bucket, thus requires the credentials to be set up.
* The follow test reads from Deephaven's s3 bucket, thus requires the credentials to be set up, else will fail.
*/
@Test
public void readMetadataPartitionedParquetFromS3() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.jetbrains.annotations.NotNull;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkAdvancedAsyncClientOption;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.http.async.SdkAsyncHttpClient;
import software.amazon.awssdk.http.crt.AwsCrtAsyncHttpClient;
Expand Down Expand Up @@ -42,8 +43,8 @@ static S3AsyncClient getAsyncClient(@NotNull final S3Instructions instructions)
S3AsyncClient s3AsyncClient;
try {
s3AsyncClient = getAsyncClientBuilder(instructions).build();
} catch (final RuntimeException e) {
if (instructions.regionName().isEmpty() && e.getMessage().contains("region")) {
} catch (final SdkClientException e) {
if (instructions.regionName().isEmpty() && e.getMessage().contains("Unable to load region")) {
// We might have failed because region was not provided and could not be determined by the SDK.
// We will try again with a default region.
s3AsyncClient = getAsyncClientBuilder(instructions).region(Region.US_EAST_1).build();
Expand Down

0 comments on commit 86b8031

Please sign in to comment.