From b1837be2bba0459e41ba67aa73a490acebbed6b9 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Wed, 24 Jan 2024 12:23:53 +0330 Subject: [PATCH 1/4] update: tc-hivemind-backend dependency increase version! --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0ab85c42..ede2af06 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,4 +16,4 @@ neo4j>=5.14.1, <6.0.0 coverage>=7.3.3, <8.0.0 pytest>=7.4.3, <8.0.0 python-dotenv>=1.0.0, <2.0.0 -tc-hivemind-backend==1.1.1 +tc-hivemind-backend==1.1.2 From 1912a61157acb181a925b7a9cb69ace32163af4c Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Wed, 24 Jan 2024 13:20:18 +0330 Subject: [PATCH 2/4] fix: test cases! The test cases were related to previous PRs of adding `fromDate` to modules collection. --- .../tests/integration/test_discord_fetch_modules_channels.py | 2 +- .../tests/integration/test_discord_fetch_raw_messages.py | 1 + .../integration/test_discord_fetch_raw_messages_grouped.py | 1 + .../tests/integration/test_discord_prepare_document_from_db.py | 1 + .../tests/integration/test_discord_prepare_grouped_data.py | 1 + .../tests/integration/test_discord_prepare_summary.py | 1 + .../tests/integration/test_pg_vector_access_with_discord.py | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_modules_channels.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_modules_channels.py index a3190685..388aaa38 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_modules_channels.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_modules_channels.py @@ -82,7 +82,7 @@ def setup_db( ) def test_fetch_channels(self): - guild_id = "12345" + guild_id = "1234" channels = ["111111", "22222"] self.setup_db( create_modules=True, diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py index 919af895..49690246 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py @@ -31,6 +31,7 @@ def setup_db( "platforms": [ { "platformId": platform_id, + "fromDate": datetime(2023, 10, 1), "options": { "channels": channels, "roles": ["role_id"], diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages_grouped.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages_grouped.py index 90d2f133..f3514461 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages_grouped.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages_grouped.py @@ -30,6 +30,7 @@ def setup_db( "platforms": [ { "platformId": platform_id, + "fromDate": datetime(2023, 10, 1), "options": { "channels": channels, "roles": ["role_id"], diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py index 4e2e2719..715d1c0d 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py @@ -33,6 +33,7 @@ def setup_db( "platforms": [ { "platformId": platform_id, + "fromDate": datetime(2023, 10, 1), "options": { "channels": channels, "roles": ["role_id"], diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_grouped_data.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_grouped_data.py index 45489c72..99a003c2 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_grouped_data.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_grouped_data.py @@ -32,6 +32,7 @@ def setup_db( "platforms": [ { "platformId": platform_id, + "fromDate": datetime(2023, 10, 1), "options": { "channels": channels, "roles": ["role_id"], diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_summary.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_summary.py index 2959aa45..6927f240 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_summary.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_summary.py @@ -40,6 +40,7 @@ def setup_db( "platforms": [ { "platformId": platform_id, + "fromDate": datetime(2023, 10, 1), "options": { "channels": channels, "roles": ["role_id"], diff --git a/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py b/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py index a6b222be..a2d9ee48 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py @@ -59,6 +59,7 @@ def setup_mongo_information( "platforms": [ { "platformId": platform_id, + "fromDate": datetime(2023, 10, 1), "options": { "channels": channels, "roles": ["role_id"], From 7c11ebd682dcd935dfb8df500506fb3a0ac3b869 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Wed, 24 Jan 2024 13:28:35 +0330 Subject: [PATCH 3/4] fix: test case! if from_date was equal to `None`, it would use the modules fromDate which in our case the modules date wasn't configured correctly! --- .../tests/integration/test_discord_prepare_document_from_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py index 715d1c0d..89d57bdf 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_prepare_document_from_db.py @@ -33,7 +33,7 @@ def setup_db( "platforms": [ { "platformId": platform_id, - "fromDate": datetime(2023, 10, 1), + "fromDate": datetime(2023, 1, 1), "options": { "channels": channels, "roles": ["role_id"], From 227ef98498b06d67613ab5d59af64880a46927f3 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Wed, 24 Jan 2024 13:31:31 +0330 Subject: [PATCH 4/4] fix: test case, same as previous one! --- .../tests/integration/test_pg_vector_access_with_discord.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py b/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py index a2d9ee48..a74a8b30 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_pg_vector_access_with_discord.py @@ -59,7 +59,7 @@ def setup_mongo_information( "platforms": [ { "platformId": platform_id, - "fromDate": datetime(2023, 10, 1), + "fromDate": datetime(2023, 1, 1), "options": { "channels": channels, "roles": ["role_id"],