From 823bf885b3c8336394a700a4b8a17c78bf8c6a50 Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Wed, 21 Jan 2026 12:22:01 -0700 Subject: [PATCH] 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 --- github_activity/github_activity.py | 2 +- github_activity/graphql.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/github_activity/github_activity.py b/github_activity/github_activity.py index 80d208f..36b61af 100644 --- a/github_activity/github_activity.py +++ b/github_activity/github_activity.py @@ -550,7 +550,7 @@ def filter_ignored(userlist): item_contributors.add(committer) # Only add merger if they're not a bot and not the author if ( - row.mergedBy + pd.notna(row.mergedBy) and row.mergedBy != row.author and not ignored_user(row.mergedBy) ): diff --git a/github_activity/graphql.py b/github_activity/graphql.py index 4d853c4..dd8295f 100644 --- a/github_activity/graphql.py +++ b/github_activity/graphql.py @@ -323,7 +323,7 @@ def is_bot(user_dict): # Add some extra fields def get_login(user): - return user["login"] if not pd.isna(user) else user + return user["login"] if pd.notna(user) else user self.data["author"] = self.data["author"].map(get_login) self.data["mergedBy"] = self.data["mergedBy"].map(get_login)