From 87038473f3a22a7bc49feacc41ecfb3c0deb9d01 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 7 Oct 2024 12:21:10 +0330 Subject: [PATCH 1/3] fix: updated to use telegram config! --- dags/telegram_analyzer_etl.py | 14 ++++++++------ requirements.txt | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dags/telegram_analyzer_etl.py b/dags/telegram_analyzer_etl.py index cccda9b9..5f20a195 100644 --- a/dags/telegram_analyzer_etl.py +++ b/dags/telegram_analyzer_etl.py @@ -12,6 +12,7 @@ from analyzer_helper.telegram.transform_raw_data import TransformRawInfo from analyzer_helper.telegram.transform_raw_members import TransformRawMembers from dateutil.parser import parse +from tc_analyzer_lib.schemas.platform_configs import TelegramAnalyzerConfig with DAG( dag_id="telegram_analyzer_etl", @@ -199,14 +200,13 @@ def analyze_telegram(platform_processed: dict[str, str | bool]) -> None: platform_data = fetcher.fetch_analyzer_parameters(platform_id) - metadata = platform_data["metadata"] - period = metadata["period"] - action = metadata["action"] - window = metadata["window"] - resources = metadata["resources"] + period = platform_data["period"] + action = platform_data["action"] + window = platform_data["window"] + resources = platform_data["resources"] analyzer = Analyzer() - + analyzer.analyze( platform_id=platform_id, resources=resources, @@ -214,6 +214,8 @@ def analyze_telegram(platform_processed: dict[str, str | bool]) -> None: action=action, window=window, recompute=recompute, + config=TelegramAnalyzerConfig(), + send_completed_message=False, ) platform_modules = fetch_telegram_platforms() diff --git a/requirements.txt b/requirements.txt index cff11004..2312c2b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,4 +21,4 @@ redis===5.0.4 tc-wikipedia-lib==1.0.1 llama-index-readers-file==0.1.22 docx2txt==0.8 -tc-analyzer-lib==1.4.10 +tc-analyzer-lib==1.4.11 From 3c236c659a575ec2733cdfc2c73bcd470be42eaf Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 7 Oct 2024 12:25:53 +0330 Subject: [PATCH 2/3] empty commit to re-run github action! From 6f87d61d607cbf98d9a78590af7ab0182c7310a8 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 7 Oct 2024 13:09:15 +0330 Subject: [PATCH 3/3] fix: black linter issue! --- dags/telegram_analyzer_etl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dags/telegram_analyzer_etl.py b/dags/telegram_analyzer_etl.py index 5f20a195..527be9b8 100644 --- a/dags/telegram_analyzer_etl.py +++ b/dags/telegram_analyzer_etl.py @@ -206,7 +206,7 @@ def analyze_telegram(platform_processed: dict[str, str | bool]) -> None: resources = platform_data["resources"] analyzer = Analyzer() - + analyzer.analyze( platform_id=platform_id, resources=resources,