Skip to content

Commit

Permalink
merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Oct 7, 2024
2 parents 6334238 + e3da7e7 commit 54bdd6f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dcicutils
Change Log
----------

8.14.4
8.16.0
======

* Minor changes to view_portal_object utility script.
Expand All @@ -15,6 +15,12 @@ Change Log
* Minor fix in misc_utils.format_duration.


8.15.0
======
* 2024-10-04 (dmichaels)
* Added optional bucket argument to s3_utils.s3Utils.read_s3 (initially for Andy).


8.14.3
======

Expand Down
6 changes: 4 additions & 2 deletions dcicutils/s3_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,10 @@ def get_key(self, keyfile_name: str = 'access_key_admin'
# maybe its not json after all
return auth_text

def read_s3(self, filename: str):
response = self.s3.get_object(Bucket=self.outfile_bucket, Key=filename)
def read_s3(self, filename: str, bucket: Optional[str] = None):
if (not isinstance(bucket, str)) or (not bucket):
bucket = self.outfile_bucket
response = self.s3.get_object(Bucket=bucket, Key=filename)
logger.info(str(response))
return response['Body'].read()

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicutils"
version = "8.14.3.1b5" # TODO: To become 8.14.4
version = "8.15.0.1b1" # TODO: To become 8.16.0
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 54bdd6f

Please sign in to comment.