Commit 577bd85 1 parent 71bfdc3 commit 577bd85 Copy full SHA for 577bd85
File tree 2 files changed +1
-15
lines changed
src/lightning/data/streaming
tests/tests_data/streaming
2 files changed +1
-15
lines changed Original file line number Diff line number Diff line change 7
7
if _BOTO3_AVAILABLE :
8
8
import boto3
9
9
import botocore
10
- from botocore .credentials import InstanceMetadataProvider
11
- from botocore .utils import InstanceMetadataFetcher
12
10
13
11
14
12
class S3Client :
@@ -31,14 +29,8 @@ def client(self) -> Any:
31
29
32
30
# Re-generate credentials for EC2
33
31
if self ._last_time is None or (time () - self ._last_time ) > self ._refetch_interval :
34
- provider = InstanceMetadataProvider (iam_role_fetcher = InstanceMetadataFetcher (timeout = 3600 , num_attempts = 5 ))
35
- credentials = provider .load ()
36
32
self ._client = boto3 .client (
37
- "s3" ,
38
- aws_access_key_id = credentials .access_key ,
39
- aws_secret_access_key = credentials .secret_key ,
40
- aws_session_token = credentials .token ,
41
- config = botocore .config .Config (retries = {"max_attempts" : 1000 , "mode" : "adaptive" }),
33
+ "s3" , config = botocore .config .Config (retries = {"max_attempts" : 1000 , "mode" : "adaptive" })
42
34
)
43
35
self ._last_time = time ()
44
36
Original file line number Diff line number Diff line change @@ -31,12 +31,6 @@ def test_s3_client_with_cloud_space_id(monkeypatch):
31
31
botocore = mock .MagicMock ()
32
32
monkeypatch .setattr (client , "botocore" , botocore )
33
33
34
- instance_metadata_provider = mock .MagicMock ()
35
- monkeypatch .setattr (client , "InstanceMetadataProvider" , instance_metadata_provider )
36
-
37
- instance_metadata_fetcher = mock .MagicMock ()
38
- monkeypatch .setattr (client , "InstanceMetadataFetcher" , instance_metadata_fetcher )
39
-
40
34
monkeypatch .setenv ("LIGHTNING_CLOUD_SPACE_ID" , "dummy" )
41
35
42
36
s3 = client .S3Client (1 )
You can’t perform that action at this time.
0 commit comments