Skip to content

Commit

Permalink
Upgrade boto3 and botocore versions to get UBAM changes (#24)
Browse files Browse the repository at this point in the history
* Upgrade boto3 and botocore versions to get UBAM changes

* Refactor to address UBAM linting issues
  • Loading branch information
duongwilAWS authored Nov 10, 2023
1 parent 262abca commit 3efbda6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
2 changes: 1 addition & 1 deletion omics/transfer/read_set_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _main(
)
upload_id = response["uploadId"]

if (args["referenceArn"] == "" and args["sourceFileType" != "FASTQ" or "UBAM"]):
if (args["referenceArn"] == "") and (args["sourceFileType"] not in ["FASTQ", "UBAM"]):
raise AttributeError("Unlinked read set file types must specify a reference ARN")

# Add a cleanup if the multipart upload fails at any point.
Expand Down
48 changes: 27 additions & 21 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ packages = [{ include = "omics" }]

[tool.poetry.dependencies]
python = "^3.10"
s3transfer = "^0.6.0"
boto3 = "^1.26.133"
mypy-boto3-omics = "^1.26.133"
botocore-stubs = "^1.29.130"
s3transfer = "^0.7.0"
boto3 = "^1.28.83"
mypy-boto3-omics = "^1.28.83"
botocore-stubs = "^1.31.83"

[tool.poetry.group.dev.dependencies]
black = "^22.8.0"
Expand Down
12 changes: 4 additions & 8 deletions tests/transfer/unit/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
from s3transfer.futures import TransferFuture
from s3transfer.utils import OSUtils

from omics.common.omics_file_types import (
ReadSetFileName,
ReferenceFileName,
)
from omics.common.omics_file_types import ReadSetFileName, ReferenceFileName
from omics.transfer.manager import TransferManager, _format_local_filename
from tests.transfer import (
TEST_CONSTANTS,
Expand Down Expand Up @@ -214,7 +211,7 @@ def test_upload_no_reference_with_BAM_file_type_exception(self):

self.stubber.assert_no_pending_responses()

def test_upload_no_reference_with_BAM_file_type_exception(self):
def test_upload_no_reference_with_CRAM_file_type_exception(self):
with self.assertRaises(AttributeError):
self.self.transfer_manager.upload_read_set(
io.BytesIO(b"some file content1"),
Expand All @@ -226,9 +223,8 @@ def test_upload_no_reference_with_BAM_file_type_exception(self):
).result()

self.stubber.assert_no_pending_responses()
def run_simple_upload(
self, files: any, file_type: str = "FASTQ"
) -> TransferFuture:

def run_simple_upload(self, files: any, file_type: str = "FASTQ") -> TransferFuture:
return self.transfer_manager.upload_read_set(
files,
TEST_CONSTANTS["sequence_store_id"],
Expand Down

0 comments on commit 3efbda6

Please sign in to comment.