Conversation
| logging.error("No recipients for batch ID: %s", batch_id) | ||
| except oracledb.Error as e: | ||
| logging.error("Error fetching recipients: %s", e) | ||
| recipients_results = oracle_database.get_recipients(batch_id) # [] |
There was a problem hiding this comment.
Ah, this was my mistake. I think I put that there during development as a reminder to myself that this could return an empty list. This was just to stop myself from switching files back and forth to check. I've removed it now
| batch_id = generate_batch_id() | ||
| routing_plan_id = get_routing_plan_id(batch_id) | ||
| recipients = None | ||
| batch_id = generate_batch_id() |
There was a problem hiding this comment.
Out of interest, why are we removing the try blocks and not logging the Oracle error here any more?
There was a problem hiding this comment.
So this was one of the suggestions from the document. It stated that since we already catch the Oracle Error in the function in the oracle db py file, then there's no need to re raise it, catch it and log it again.
Instead it was suggested that returning None and logging that nothing was returned, from the calling function was better.
Also, it keeps Oracle specific code, e.g. catching an oracle error, in one oracle implementation file
| response_codes = [] | ||
| for data in json_data.get('data', [{}]): | ||
| def record_message_statuses(json_data: dict) -> dict[str, int]: | ||
| response_counts = {"0": 0, "non_zero": 0} |
There was a problem hiding this comment.
| response_counts = {"0": 0, "non_zero": 0} | |
| response_counts = {"zero": 0, "non_zero": 0} |
There was a problem hiding this comment.
Applied this improvement
| response_code = record_message_status(data) | ||
| response_codes.append(response_code) | ||
| if response_code == 0: | ||
| response_counts["0"] += 1 |
There was a problem hiding this comment.
| response_counts["0"] += 1 | |
| response_counts["zero"] += 1 |
There was a problem hiding this comment.
Applied this improvement
|
Looks like maybe your IDE has done some auto-formatting - you'll need to lint this repo I'm afraid, it's currently failing the linting job. |
Lambda requested changes.docx
Applied all P1 changes in the attached word document