Skip to content

Commit f7283d7

Browse files
authored
[patch] fix usage of GitHubAPI in get-prs.py (#120)
* Linting * patch: update usage of GitHubAPI
1 parent 8e88284 commit f7283d7

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

scripts/get-prs.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
"""A script that parses all active pyOS repos and collects contributor and
2-
activity information in the form of opened issues and pull requests.
1+
"""A script that parses all active pyOS repos and collects contributor and
2+
activity information in the form of opened issues and pull requests.
33
44
This script returns a `.csv` file that contains all issue and pr data for items:
55
6-
* not created by a bot
6+
* not created by a bot
77
* and created in the specific current year.
88
9-
The one issue with this workflow is that if it doesn't run on the last day of
10-
the year, then it won't capture the last pr's that might happen on new years
11-
eve week.
9+
The one issue with this workflow is that if it doesn't run on the last day of
10+
the year, then it won't capture the last pr's that might happen on new years
11+
eve week.
1212
13-
This will allow us to track contribution growth overtime.
13+
This will allow us to track contribution growth overtime.
1414
15-
Ideally this should be run as a cron job, a workflow dispatch and then
16-
on near years eve
15+
Ideally this should be run as a cron job, a workflow dispatch and then
16+
on near years eve
1717
1818
# Run specifically on New Year's Eve at 11:30 PM
1919
- cron: '30 23 31 12 *'
20-
20+
2121
That way we are sure to capture data for the entirety of 2024 on new years eve!!xw
2222
"""
2323

@@ -66,7 +66,7 @@ def get_repo_data(
6666
"""
6767

6868
github_api.endpoint_type = endpoint_type
69-
items = github_api.return_response()
69+
items = github_api._get_response_rest(github_api.api_endpoint)
7070
contrib_type = "contributor"
7171

7272
data = []
@@ -128,8 +128,8 @@ def process_repo(github_api, repo_name, contrib_types, user_location_cache):
128128
129129
Returns
130130
-------
131-
dict
132-
A dictionary containing the processed issues and pull requests of the repository.
131+
pandas.DataFrame
132+
A DataFrame containing the processed issues and pull requests of the repository.
133133
134134
Raises
135135
------
@@ -154,6 +154,7 @@ def process_repo(github_api, repo_name, contrib_types, user_location_cache):
154154
return all_contribs_df
155155
except Exception as e:
156156
logging.error(f"An error occurred: {e}")
157+
return pd.DataFrame()
157158

158159

159160
# Set this to True if you want to update the 2018-2023 data

0 commit comments

Comments
 (0)