Skip to content

Commit ca98718

Browse files
committed
refactor(analytics): add a null check for username to filter_non_bot_events
1 parent cabda7a commit ca98718

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backend/analytics_server/mhq/service/code/sync/etl_code_analytics.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,9 @@ def filter_non_bot_events(
184184
self, pr_events: List[PullRequestEvent]
185185
) -> List[PullRequestEvent]:
186186
"""Filter out events created by bot users using regex patterns."""
187-
return [event for event in pr_events if (not is_bot_name(event.actor_username))]
187+
return [
188+
event
189+
for event in pr_events
190+
if event.actor_username is not None
191+
and (not is_bot_name(event.actor_username))
192+
]

0 commit comments

Comments
 (0)