Skip to content

Commit 27fa0a0

Browse files
committed
feat(#183): if empty
1 parent 825925c commit 27fa0a0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sr-data/src/sr_data/steps/gh_mentions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ def main(repos, out):
3333
logger.info(
3434
f"Counting GitHub pull request, and issue mentions in {len(frame)} repositories"
3535
)
36-
frame[["readme_pmentions", "readme_imentions"]] = (
37-
frame["readme"].apply(mentions)).apply(pd.Series)
36+
if frame.empty:
37+
frame["readme_pmentions"] = 0
38+
frame["readme_imentions"] = 0
39+
else:
40+
frame[["readme_pmentions", "readme_imentions"]] = (
41+
frame["readme"].apply(mentions)).apply(pd.Series)
3842
frame.to_csv(out, index=False)
3943
logger.info(f"Saved {len(frame)} repositories to {out}")
4044

0 commit comments

Comments
 (0)