Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Handle and move date columns to right at the end #175

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [[email protected]](mailto:[email protected])
Expand Down
11 changes: 10 additions & 1 deletion deploy/cttso-ica-to-pieriandx-cdk/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [[email protected]](mailto:[email protected])

### 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: [[email protected]](mailto:[email protected])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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]

Expand Down