Skip to content

Commit f59da4d

Browse files
Remove deprecated s3 handler code (#343)
## Description Removes old s3_handler.py nested in ttc lambda; code all now lives under `lambda-handler` fixes a ruff issue and import fix for augmentation folder ## Related Issues Closes blocking bug ## Additional Notes [Add any additional context or notes that reviewers should know about.] <--------------------- REMOVE THE LINES BELOW BEFORE MERGING ---------------------> ## Checklist Please review and complete the following checklist before submitting your pull request: - [ ] I have ensured that the pull request is of a manageable size, allowing it to be reviewed within a single session. - [ ] I have reviewed my changes to ensure they are clear, concise, and well-documented. - [ ] I have updated the documentation, if applicable. - [ ] I have added or updated test cases to cover my changes, if applicable. - [ ] I have minimized the number of reviewers to include only those essential for the review. ## Checklist for Reviewers Please review and complete the following checklist during the review process: - [ ] The code follows best practices and conventions. - [ ] The changes implement the desired functionality or fix the reported issue. - [ ] The tests cover the new changes and pass successfully. - [ ] Any potential edge cases or error scenarios have been considered.
1 parent c830fd6 commit f59da4d

File tree

3 files changed

+9
-166
lines changed

3 files changed

+9
-166
lines changed

packages/augmentation/src/augmentation/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from io import BytesIO
44

5+
from lambda_handler.lambda_handler import put_file
56
from shared_models import TTCAugmenterInput
6-
from text_to_code_lambda.s3_handler import put_file
77

88
from augmentation.models import Metadata
99
from augmentation.models import TTCAugmenterConfig
@@ -25,7 +25,11 @@ def _save_eicr(eicr: str, eicr_id: str) -> None:
2525

2626
def _save_metadata(metadata: Metadata) -> None:
2727
"""Save augmentation metadata to S3 bucket."""
28-
put_file(BytesIO(metadata.model_dump_json().encode("utf-8")), "augmentation_metadata", f"{metadata.augmented_eicr_id}_metadata.json")
28+
put_file(
29+
BytesIO(metadata.model_dump_json().encode("utf-8")),
30+
"augmentation_metadata",
31+
f"{metadata.augmented_eicr_id}_metadata.json",
32+
)
2933

3034

3135
def augment(input: TTCAugmenterInput) -> None:

packages/augmentation/tests/unit/test_eicr_augmenter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from zoneinfo import ZoneInfo
55

66
import pytest
7-
from augmentation.models import Metadata
8-
from augmentation.models import NonstandardCodeInstanceMetadata
97
from augmentation.models.config import ApplicationCode
108
from augmentation.models.config import AugmenterConfig
119
from augmentation.models.config import TTCAugmenterConfig
@@ -16,6 +14,9 @@
1614
from shared_models import DataField
1715
from shared_models import NonstandardCodeInstance
1816

17+
from augmentation.models import Metadata
18+
from augmentation.models import NonstandardCodeInstanceMetadata
19+
1920
EXAMPLE_EICRS_DIRECTORY = Path(__file__).parent.parent / "assets"
2021
DATA_CONFIG: AugmenterConfig = TTCAugmenterConfig()
2122
BASE_XPATH = "/ClinicalDocument/component/structuredBody/component/section/entry/component/observation/code/originalText/text()"

packages/text-to-code-lambda/src/text_to_code_lambda/s3_handler.py

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)