Skip to content

Commit

Permalink
Remove unnecessary kwarg for getting S3 client
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris committed Sep 13, 2024
1 parent 4226ec5 commit 0e41f29
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions emmaa/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def assemble_pysb(self, mode='local', bucket=EMMAA_BUCKET_NAME):
fname = f'{exp_f}_{self.date_str}.{exp_f}'
pa.export_model(exp_f, fname)
logger.info(f'Uploading {fname}')
client = get_s3_client(unsigned=False)
client = get_s3_client()
client.upload_file(fname, bucket,
f'exports/{self.name}/{fname}')
return pysb_model
Expand All @@ -588,7 +588,7 @@ def assemble_pybel(self, mode='local', bucket=EMMAA_BUCKET_NAME):
fname = f'pybel_{self.date_str}.bel.nodelink.json.gz'
pybel.dump(pybel_model, fname)
logger.info(f'Uploading {fname}')
client = get_s3_client(unsigned=False)
client = get_s3_client()
client.upload_file(fname, bucket, f'exports/{self.name}/{fname}')
return pybel_model

Expand All @@ -609,7 +609,7 @@ def assemble_signed_graph(self, mode='local', bucket=EMMAA_BUCKET_NAME):
df = ia.make_df()
df.to_csv(fname, sep='\t', index=False)
logger.info(f'Uploading {fname}')
client = get_s3_client(unsigned=False)
client = get_s3_client()
client.upload_file(fname, bucket, f'exports/{self.name}/{fname}')
return signed_graph

Expand Down Expand Up @@ -647,7 +647,7 @@ def assemble_dynamic_pysb(self, mode='local', bucket=EMMAA_BUCKET_NAME):
pysb_to_gromet(pysb_model, self.name,
self.dynamic_assembled_stmts, fname)
logger.info(f'Uploading {fname}')
client = get_s3_client(unsigned=False)
client = get_s3_client()
client.upload_file(fname, bucket,
f'exports/{self.name}/{fname}')
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions emmaa/model_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def answer_dynamic_query(self, query, bucket=EMMAA_BUCKET_NAME):
s3_key = (f'query_images/{self.model.name}/{fig_name}_'
f'{date_str}{ext}')
s3_path = f'https://{bucket}.s3.amazonaws.com/{s3_key}'
client = get_s3_client(unsigned=False)
client = get_s3_client()
logger.info(f'Uploading image to {s3_path}')
client.upload_file(fig_path, Bucket=bucket, Key=s3_key)
fig_path = s3_path
Expand Down Expand Up @@ -397,7 +397,7 @@ def answer_intervention_query(self, query, bucket=EMMAA_BUCKET_NAME):
s3_key = (f'query_images/{self.model.name}/{fig_name}_'
f'{date_str}{ext}')
s3_path = f'https://{bucket}.s3.amazonaws.com/{s3_key}'
client = get_s3_client(unsigned=False)
client = get_s3_client()
logger.info(f'Uploading image to {s3_path}')
client.upload_file(fig_path, Bucket=bucket, Key=s3_key)
fig_path = s3_path
Expand Down
2 changes: 1 addition & 1 deletion emmaa/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def find_latest_emails(email_type, time_delta=None, w_dt=False):


def get_email_content(key):
s3 = get_s3_client(unsigned=False)
s3 = get_s3_client()
email_obj = s3.get_object(Bucket=email_bucket, Key=key)
return email_obj['Body'].read().decode()

Expand Down

0 comments on commit 0e41f29

Please sign in to comment.