From 30086f00ab306c7bbf752e86620a950c29235c99 Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 Nov 2023 12:46:57 +1100 Subject: [PATCH 1/2] Handle and move date columns to right at the end, don't adjust missing date columns --- .../lambda_code.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py index 8cc1312..df6f153 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py @@ -160,12 +160,6 @@ def lambda_handler(event, context): axis="columns" ) - # Convert times to utc time and strings - for date_column in ["date_received", "date_collected", "date_of_birth"]: - sample_df[date_column] = sample_df[date_column].apply( - lambda x: datetime_obj_to_utc_isoformat(handle_date(x)) - ) - # Assert expected values exist logger.info("Check we have all of the expected information") for expected_column in EXPECTED_ATTRIBUTES: @@ -195,6 +189,14 @@ def lambda_handler(event, context): } ) + # Convert times to utc time and strings + for date_column in ["date_received", "date_collected", "date_of_birth"]: + if date_column not in sample_df.columns.tolist(): + continue + sample_df[date_column] = sample_df[date_column].apply( + lambda x: datetime_obj_to_utc_isoformat(handle_date(x)) + ) + # Launch batch lambda function accession_json: Dict = sample_df.to_dict(orient="records")[0] From 7fc5b6c112e30b84e9072664712d4de9a8f07f39 Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 Nov 2023 12:50:10 +1100 Subject: [PATCH 2/2] Update deployment changelog And fix dates of previous changelog entry --- Changelog.md | 2 +- deploy/cttso-ica-to-pieriandx-cdk/Changelog.md | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 0fb0676..078c9bf 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,7 +4,7 @@ Changes in this log refer only to changes that make it to the 'main' branch. and For changes in deployment, please see the [deployment changelog](deploy/cttso-ica-to-pieriandx-cdk/Changelog.md) -## 2023-11-17 +## 2023-11-07 > Author: Alexis Lucattini > Email: [Alexis.Lucattini@umccr.org](mailto:alexis.lucattini@umccr.org) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md index 732ade4..6bc280b 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md +++ b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md @@ -3,7 +3,16 @@ Changes in this log refer only to changes that make it to the 'main' branch and are nested under deploy/cttso-ica-to-pieriandx-cdk. -## 2023-11-17 +## 2023-11-08 + +> Author: Alexis Lucattini +> Email: [Alexis.Lucattini@umccr.org](mailto:alexis.lucattini@umccr.org) + +### Hotfixes +* Update date columns check (https://github.com/umccr/cttso-ica-to-pieriandx/pull/174) + * Resolves (https://github.com/umccr/cttso-ica-to-pieriandx/issues/173) + +## 2023-11-07 > Author: Alexis Lucattini > Email: [Alexis.Lucattini@umccr.org](mailto:alexis.lucattini@umccr.org)