File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11from doubleml import DoubleMLData
22import os
3- import boto3
3+ from botocore . session import Session
44import pandas as pd
55
66
@@ -50,7 +50,8 @@ def from_s3(cls,
5050 x_cols = None ,
5151 z_cols = None ,
5252 use_other_treat_as_covariate = True ):
53- s3_client = boto3 .client ('s3' )
53+ session = Session ()
54+ s3_client = session .create_client ('s3' )
5455 response = s3_client .get_object (Bucket = bucket ,
5556 Key = file_key )
5657 file = response ["Body" ]
@@ -65,7 +66,8 @@ def store_and_upload_to_s3(self):
6566 # load csv as a pd.DataFrame
6667 file_name = os .path .split (self .file_key )[1 ]
6768 self .data .to_csv (file_name )
68- s3_client = boto3 .client ('s3' )
69+ session = Session ()
70+ s3_client = session .create_client ('s3' )
6971 response = s3_client .upload_file (Filename = file_name ,
7072 Bucket = self .bucket ,
7173 Key = self .file_key )
You can’t perform that action at this time.
0 commit comments