File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
tensorflow_io/core/plugins/s3 Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -135,8 +135,6 @@ static Aws::Client::ClientConfiguration& GetDefaultClientConfig() {
135
135
absl::MutexLock l (&cfg_lock);
136
136
137
137
if (!init) {
138
- const char * endpoint = getenv (" S3_ENDPOINT" );
139
- if (endpoint) cfg.endpointOverride = Aws::String (endpoint);
140
138
const char * region = getenv (" AWS_REGION" );
141
139
// TODO (yongtang): `S3_REGION` should be deprecated after 2.0.
142
140
if (!region) region = getenv (" S3_REGION" );
@@ -241,9 +239,13 @@ static void GetS3Client(tf_s3_filesystem::S3File* s3_file) {
241
239
tf_s3_filesystem::AWSLogSystem::ShutdownAWSLogging ();
242
240
}
243
241
});
242
+
244
243
int temp_value;
245
244
if (absl::SimpleAtoi (getenv (" S3_DISABLE_MULTI_PART_DOWNLOAD" ), &temp_value))
246
245
s3_file->use_multi_part_download = (temp_value != 1 );
246
+
247
+ const char * endpoint = getenv (" S3_ENDPOINT" );
248
+ if (endpoint) s3_file->s3_client ->OverrideEndpoint (endpoint);
247
249
}
248
250
}
249
251
Original file line number Diff line number Diff line change @@ -51,9 +51,7 @@ def test_read_file():
51
51
response = client .get_object (Bucket = bucket_name , Key = key_name )
52
52
assert response ["Body" ].read () == body
53
53
54
- os .environ ["S3_ENDPOINT" ] = "localhost:4566"
55
- os .environ ["S3_USE_HTTPS" ] = "0"
56
- os .environ ["S3_VERIFY_SSL" ] = "0"
54
+ os .environ ["S3_ENDPOINT" ] = "http://localhost:4566"
57
55
58
56
content = tf .io .read_file ("s3://{}/{}" .format (bucket_name , key_name ))
59
57
assert content == body
You can’t perform that action at this time.
0 commit comments