Skip to content

Commit 823bf88

Browse files
committed
Handle a mergedBy NaN value
This avoids a TypeError when retrieving PRs that have not been merged, which was causing a critical error. From where mergedBy is set, it can be a pandas na or it can be a username. Fixes #164
1 parent f15ed08 commit 823bf88

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

github_activity/github_activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def filter_ignored(userlist):
550550
item_contributors.add(committer)
551551
# Only add merger if they're not a bot and not the author
552552
if (
553-
row.mergedBy
553+
pd.notna(row.mergedBy)
554554
and row.mergedBy != row.author
555555
and not ignored_user(row.mergedBy)
556556
):

github_activity/graphql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def is_bot(user_dict):
323323

324324
# Add some extra fields
325325
def get_login(user):
326-
return user["login"] if not pd.isna(user) else user
326+
return user["login"] if pd.notna(user) else user
327327

328328
self.data["author"] = self.data["author"].map(get_login)
329329
self.data["mergedBy"] = self.data["mergedBy"].map(get_login)

0 commit comments

Comments
 (0)