From 071d5fe4eee9498903543bffc2daf369606c13e7 Mon Sep 17 00:00:00 2001 From: motalm Date: Mon, 4 Nov 2024 13:27:39 +0000 Subject: [PATCH 1/3] upload call history -> 1 paramater (request) for gen2 --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 1bb7f85..51f585b 100644 --- a/main.py +++ b/main.py @@ -22,7 +22,7 @@ def delete_old_call_history(_event, _context): call_history_client.delete_historical_call_history() -def upload_call_history(_event, _context): +def upload_call_history(request): print("Running Cloud Function - upload_call_history") config = Config.from_env() config.log() From 5633c1e150a71ae2a68644b0dc5c8adf73669650 Mon Sep 17 00:00:00 2001 From: motalm Date: Mon, 4 Nov 2024 13:46:06 +0000 Subject: [PATCH 2/3] upload call history now returns "done" --- main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/main.py b/main.py index 51f585b..fec3b0d 100644 --- a/main.py +++ b/main.py @@ -29,6 +29,7 @@ def upload_call_history(request): datastore_client = datastore.Client() call_history_client = CallHistoryClient(datastore_client, config) call_history_client.call_history_extraction_process() + return "done" def deliver_mi_hub_reports_trigger(_event, _context): From 86fcb32df5088488bd938e72fb6a9d6d69e2de51 Mon Sep 17 00:00:00 2001 From: kristian4res <57638182+kristian4res@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:11:25 +0000 Subject: [PATCH 3/3] style: string casing and run format --- main.py | 2 +- tests/data_sources/test_datastore_data.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index fec3b0d..3c9db88 100644 --- a/main.py +++ b/main.py @@ -29,7 +29,7 @@ def upload_call_history(request): datastore_client = datastore.Client() call_history_client = CallHistoryClient(datastore_client, config) call_history_client.call_history_extraction_process() - return "done" + return "Done" def deliver_mi_hub_reports_trigger(_event, _context): diff --git a/tests/data_sources/test_datastore_data.py b/tests/data_sources/test_datastore_data.py index 57f5514..151c5a9 100644 --- a/tests/data_sources/test_datastore_data.py +++ b/tests/data_sources/test_datastore_data.py @@ -146,7 +146,9 @@ def test_get_cati_call_history(mock_get_cati_call_history_from_database): def test_filter_out_existing_call_history_records( mock_call_history_keys, ): - mock_call_history_keys.return_value = {"1-1-0-OPN2101A-1001011-2021/05/19 14:59:01": None} + mock_call_history_keys.return_value = { + "1-1-0-OPN2101A-1001011-2021/05/19 14:59:01": None + } call_history_data = [ CallHistory(