From 52d8b6ea520d076b2c1f7db303ceb4fd6ca9a6db Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Thu, 29 Feb 2024 17:16:34 +0330 Subject: [PATCH] fix: trying more fixing linter issues! --- app.py | 1 - utils/process_guild_data.py | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app.py b/app.py index 0d99fa7..868b654 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,6 @@ import pandas as pd import streamlit as st - from utils.mongo import MongoSingleton from utils.process_guild_data import process_guild_data diff --git a/utils/process_guild_data.py b/utils/process_guild_data.py index db231ea..abe7f83 100644 --- a/utils/process_guild_data.py +++ b/utils/process_guild_data.py @@ -4,7 +4,6 @@ def process_guild_data(platform_document: dict) -> dict[str, str | datetime | None]: - data: dict[str, str | datetime | None] = {} platform_id = str(platform_document["_id"]) guild_id = platform_document["metadata"]["id"] @@ -18,12 +17,6 @@ def process_guild_data(platform_document: dict) -> dict[str, str | datetime | No else: selected_channel_count = -1 - data["guild_id"] = guild_id - data["guild_name"] = guild_name - data["connected_at"] = connected_at - data["platform_id"] = platform_id - data["disconnected_at"] = disconnected_at - # getting the latest dates raw_infos_date = utils.get_latest_discord_raw_info_date() fired_sage_date = utils.get_latest_fired_saga(platform_id=platform_id) @@ -37,13 +30,20 @@ def process_guild_data(platform_document: dict) -> dict[str, str | datetime | No from_date=datetime.now() - timedelta(days=31) ) - data["selected_channels_count"] = selected_channel_count - data["extracted_channel_counts"] = len(extracted_channels) - data["latest_raw_info"] = raw_infos_date - data["latest_analyzer_run_fired_saga"] = fired_sage_date - data["latest_heatmaps"] = heatmaps_date - data["latest_memberactivities"] = memberactivities_date - data["raw_data_count_30days"] = raw_data_count - data["guild_members_count"] = guild_members_count + data: dict[str, str | int | datetime | None] = { + "guild_id": guild_id, + "guild_name": guild_name, + "connected_at": connected_at, + "platform_id": platform_id, + "disconnected_at": disconnected_at, + "selected_channels_count": selected_channel_count, + "extracted_channel_counts": len(extracted_channels), + "latest_raw_info": raw_infos_date, + "latest_analyzer_run_fired_saga": fired_sage_date, + "latest_heatmaps": heatmaps_date, + "latest_memberactivities": memberactivities_date, + "raw_data_count_30days": raw_data_count, + "guild_members_count": guild_members_count + } return data