Skip to content

Commit

Permalink
fix: violation detection fix extraction query!
Browse files Browse the repository at this point in the history
  • Loading branch information
amindadgar committed Aug 8, 2024
1 parent b196840 commit 4f30968
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dags/violation_detection_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def process_platforms(platform: dict[str, Any]):
recompute = platform["recompute"]
discord_users = platform["selected_discord_users"]

logging.info(f"Processing PLATFORM_ID: {platform_id}!")

# EXTRACT

# TODO: Get resource_identifier from platform analyzer config
Expand All @@ -72,6 +74,7 @@ def process_platforms(platform: dict[str, Any]):

# Load
if len(transformed_data) != 0:
logging.info(f"Loading {len(transformed_data)} documents into db!")
loader = LoadPlatformLabeledData()
loader.load(platform_id=platform, transformed_data=transformed_data)

Expand All @@ -84,7 +87,9 @@ def process_platforms(platform: dict[str, Any]):
reporter = SendReportDiscordUser(platform_id=platform_id)
reporter.send(discord_user_id=discord_id, message=report)
else:
logging.warning("No documents were transformed!")
logging.warning(
f"PLATFORM_ID: {platform_id}, No documents were transformed!"
)

platforms = get_violation_modules()
process_platforms.expand(platform=platforms)
2 changes: 1 addition & 1 deletion dags/violation_detection_helpers/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def extract(
{
**date_query,
"text": {"$ne": None},
"source_id": {"$in": resources},
self.resource_name: {"$in": resources},
}
)
return cursor, override_recompute
Expand Down

0 comments on commit 4f30968

Please sign in to comment.