Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added logs to identify which platform is being processed! #338

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dags/analyzer_helper/discourse/transform_raw_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

from analyzer_helper.discourse.utils.convert_date_time_formats import (
DateTimeFormatConverter,
)
Expand Down Expand Up @@ -90,7 +92,7 @@ def create_data_entry(

def transform(self, raw_data: list) -> list:
transformed_data = []
for entry in raw_data:
for idx, entry in enumerate(raw_data):
# Create main post entry
transformed_data.append(self.create_data_entry(entry))

Expand All @@ -115,4 +117,6 @@ def transform(self, raw_data: list) -> list:
)
# TODO: Create entry for mentioned users

logging.info(f"Preparing raw data: {idx + 1}/{len(raw_data)}")

return transformed_data
4 changes: 3 additions & 1 deletion dags/analyzer_helper/discourse/transform_raw_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ def transform(self, raw_members: list) -> list:
"""
transformed_members = []

for member in raw_members:
for idx, member in enumerate(raw_members):
try:
transformed_member = self.transform_member(member=member)
transformed_members.append(transformed_member)

logging.info(f"Preparing raw members: {idx + 1}/{len(raw_members)}")
except Exception as e:
logging.error(f"Error transforming raw discourse member {member}: {e}")

Expand Down
3 changes: 3 additions & 0 deletions dags/discourse_analyzer_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def discourse_etl_raw_data(
}
```
"""
logging.info(f"Processing platform: {platform_info}")

amindadgar marked this conversation as resolved.
Show resolved Hide resolved
platform_id = platform_info["platform_id"]
forum_endpoint = platform_info["id"]
period = platform_info["period"]
Expand Down Expand Up @@ -147,6 +149,7 @@ def discourse_etl_raw_members(
}
```
"""
logging.info(f"Processing platform: {platform_info}")
amindadgar marked this conversation as resolved.
Show resolved Hide resolved
platform_id = platform_info["platform_id"]
forum_endpoint = platform_info["id"]
# period = platform_info["period"]
Expand Down
Loading