Skip to content

Commit

Permalink
fix: trying more fixing linter issues!
Browse files Browse the repository at this point in the history
  • Loading branch information
amindadgar committed Feb 29, 2024
1 parent 73dc718 commit 52d8b6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 15 additions & 15 deletions utils/process_guild_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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)
Expand All @@ -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

0 comments on commit 52d8b6e

Please sign in to comment.